Merge Header file and detail file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Merge Header file and detail file

Postby avinashmusic » Thu Dec 26, 2013 4:29 pm

Hi Billy,

Can you just explain the OUTLEN code phrase for me? that would do, rest i get it myself
avinashmusic
 
Posts: 21
Joined: Tue Dec 24, 2013 4:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: Merge Header file and detail file

 

Re: Merge Header file and detail file

Postby BillyBoyo » Thu Dec 26, 2013 4:44 pm

Yes.

It is not OUTLEN, it is IFOUTLEN. It is not an IF of any type.

SORT will try to keep try of output lenghts in IFTHENs that have been adjusted by BUILD/OVERLAY. However, sometimes you need to tell SORT the output length from IFTHENs. And sometimes, our case, it is just the easiest way to adjust the record-length, where we want to cut the output record down from 161 bytes (on the REFORMAT record) to, in our case, 80 bytes for output.

If you read IFOUTLEN=80 as "set-the-record-length-for-the-ouptut-to-80" then you've got it.

And remember to explain the rest to us once you understand it. It is a way to learn. Better is to attempt it yourself first, which you will do next time..
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Merge Header file and detail file

Postby skolusu » Thu Dec 26, 2013 10:04 pm

Another way of getting the desired results is to simply concatenate both files to sortin as they have same DCB properties and validate the indicator


//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DISP=SHR,DSN=Your Input FB 200 Byte file1
//         DD DISP=SHR,DSN=Your Input FB 200 Byte file2
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(201:8,4)),
        IFTHEN=(WHEN=NONE,OVERLAY=(201:2,4))           
 
  SORT FIELDS=(201,4,CH,A,1,1,CH,D),EQUALS               
  OUTREC BUILD=(1,200)                                   
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post