# Record length of print file

**URL:** <https://techcommunity.softwareag.com/t/record-length-of-print-file/100580>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [May 17, 2012, 6:54pm UTC](https://techcommunity.softwareag.com/t/record-length-of-print-file/100580 "2012-05-17T18:54:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan4](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@Dan4](https://techcommunity.softwareag.com/u/Dan4)\
**Post date:** [May 17, 2012, 6:54pm UTC](https://techcommunity.softwareag.com/t/record-length-of-print-file/100580/1 "2012-05-17T18:54:01Z")

</div>

I’m writing a job that will transfer property from one agency to another. It does the following:

- Step 1 uses ICETOOL to check for possible duplicate fields in an input dataset supplied by a state agency. (It looks at two fields: SENDING PROPERTY ITEM NUMBER and RECEIVING PROPERTY ITEM NUMBER). It it finds any duplicates, they’re written to an error file and processing terminates. If it doesn’t find any, the report will have a record count of 0 and processing continues.  
Step 2 combines the two error files into one error file.  
Step 3 executes a Natural program to run the input file against production data to ensure that no duplicate records will be created for the receiving agency in the property transfer. If there are possible duplicates, they’re written to the same error file as above, and processing terminates.

If either step has an abnormal termination, another job is triggered that will notify selected individuals of the errors via e-mail, using the error file as the e-mail attachment.

My problem is that the error file in steps 1 & 2 has a record length of 133. But when I add the third step, the length of the error dataset changes to 252 and I get a “severe error” message when I try to look at the dataset.

Here’s my JCL:

```auto

//STEP01 EXEC PGM=ICETOOL                                    
//TOOLMSG DD SYSOUT=A                                         
//DFSMSG DD SYSOUT=A                                         
//IN1 DD DSN=PROPERTY.INPUT,DISP=SHR                  
//SENDITEM DD DSN=DUP.ITEMS.SEND.RPT,DISP=(NEW,CATLG),        
// DCB=(RECFM=FBA,LRECL=133)                        
//RECVITEM DD DSN=DUP.ITEMS.RECV.RPT,DISP=(NEW,CATLG),        
// DCB=(RECFM=FBA,LRECL=133)                        
//DUPS DD DSN=DUP.ITEMS,DISP=(NEW,CATLG),         
// DCB=(RECFM=FB,LRECL=177)                         
//TOOLIN DD *                                                
* OUTPUT REPORT SHOWING ANY RECORDS WITH DUPLICATE ITEM NUMBERS
  SELECT FROM(IN1) TO(DUPS) ON(1,14,CH) ALLDUPS                
  DISPLAY FROM(DUPS) LIST(SENDITEM) WIDTH(133) -               
    TITLE('DUPLICATE SENDING ITEMS') -                         
    NOHEADER -                                                 
    ON(1,6,CH,L'AGCY ') -                                       
    ON(7,8,CH,L'ITEM # ') -                                    
    COUNT('TOTAL DUPLICATE SENDING ITEMS:') EDCOUNT(U05)       
  SELECT FROM(IN1) TO(DUPS) ON(30,8,CH) ALLDUPS                
  DISPLAY FROM(DUPS) LIST(RECVITEM) WIDTH(133) -          
    TITLE(' ') -                                          
    TITLE('DUPLICATE RECEIVING ITEMS') -                  
    NOHEADER -                                            
    ON(15,6,CH,L'AGCY ') -                                 
    ON(30,8,CH,L'ITEM # ') -                              
    COUNT('TOTAL DUPLICATE RECEIVING ITEMS:') EDCOUNT(U05)
  COUNT FROM(DUPS) HIGHER(0) RC4                          
/*                                                        
//*                                                       
//STEP02 EXEC PGM=SYNCSORT                              
//SYSOUT DD SYSOUT=A                                    
//SORTIN DD DSN=DUP.ITEMS.SEND.RPT,DISP=SHR            
// DD DSN=DUP.ITEMS.RECV.RPT,DISP=SHR            
//SORTOUT DD DSN=PROPERTY.XFER.ERRORS,DISP=(NEW,CATLG),  
// DCB=(RECFM=FBA,LRECL=133)                   
//SYSIN DD *                                           
     SORT FIELDS=COPY                                     
     END                                                  
/*                                                        
//*                                                          
//STEP03 EXEC NATTPROC,NATPGM=XXXXX,CNTL=XXXXX,COND=(0,NE),
// PRTOUT=A,SYSOUT=A,JCLOUT=D                        
//CMWKF01 DD DSN=PROPERTY.INPUT,DISP=SHR                
//CMPRT01 DD DSN=PROPERTY.XFER.ERRORS,DISP=MOD              
//SYSIN DD *                                              
LOGON XXXXXXXX                                                                                       
EX PROPXFER                                                  
//
```

Here are the WRITE(1) statements within the PROPXFER program:

```auto

READ WORK FILE 1 #WKF01                                   
  ADD 1 TO #WF1-READ                                      
  MOVE #TO-AGCY TO #PROPKEY-AGCY                            
  MOVE #TO-ITEM TO #PROPKEY-ITEM                          
  FIND NUMBER PROPERTY WITH PROPKEY = #PROPKEY              
  IF *NUMBER > 0                                          
    ADD 1 TO #DUPLICATES                                  
    IF #DUPLICATES = 1                                    
      WRITE(1) NOTITLE '*'(40) /                           
        'DUPLICATE RECORDS WHICH WOULD BE CREATED FOR AGENCY' #TO-AGCY ':'                                       
    END-IF                                                
    WRITE(1) NOTITLE 'ITEM #:' #TO-ITEM                   
  END-IF                                                  
END-WORK                                                  
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [May 17, 2012, 7:44pm UTC](https://techcommunity.softwareag.com/t/record-length-of-print-file/100580/2 "2012-05-17T19:44:22Z")

</div>

- check the Natural parameter settings for printer (1),
- try a FORMAT (1) LS=133 in your program, or
- add DCB information to CMPRT01 in STEP03.

---

<div class="post-metadata">

**Author:** ![Dan4](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@Dan4](https://techcommunity.softwareag.com/u/Dan4)\
**Post date:** [May 17, 2012, 10:33pm UTC](https://techcommunity.softwareag.com/t/record-length-of-print-file/100580/3 "2012-05-17T22:33:15Z")

</div>

> [@Wolfgang Winter](#):
>
> - check the Natural parameter settings for printer (1),
> - try a FORMAT (1) LS=133 in your program, or
> - add DCB information to CMPRT01 in STEP03.

I still got a record length of 252 with the FORMAT (1) LS=133 statement, but adding the DCB information to CMPRT01 did the trick. Thanks Wolfgang!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/record-length-of-print-file/100580/4 "2021-04-02T15:01:59Z")

</div>


