DFSORT for taking records one by one



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

DFSORT for taking records one by one

Postby neverfail2try » Sun Mar 31, 2013 2:53 am

Hi all, please help me with this. I have written a JCL which uses DFSORT and does the following function
1) Input file one : Consists of 50 rows with records length 9.
2) Input file two: Consists of 100 rows with records length 3.

Problem : I have to take one record every time from input file 2 and paste it in the position 4 to 6 in all the rows of input file 1 which means there will be 5000 records in the output file.
file 1:
aaabbbccc
dddeeefff
ggghhhiii

file 2:
111
222
333

Desired Output file :
aaa111ccc
ddd111fff
ggg111iii
aaa222ccc
ddd222fff
ggg222iii
aaa333ccc
ddd333fff
ggg333iii

The JCL which I have written is allowing only the first record number provided in the SYSIN DD statement. I am just getting the output as :
aaa111ccc
ddd111fff
ggg111iii

I have used the above example just for explanation purpose, the real JCL looks like below:

//STEP010 EXEC PGM=SORT
    //SYSOUT DD SYSOUT=*   
    //SORTIN DD *         
    //SORTOUT  DD  DSN=**.****.OUTPUT1,                         
    //             DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(5,5),RLSE)
    //SYSIN    DD *                                             
      SORT FIELDS=COPY                                           
      OUTREC FIELDS=(1,9,50:SEQNUM,5,ZD,START=00001,INCR=1)     
    /*                                                           
    //STEP020  EXEC  PGM=SORT                                   
    //SYSOUT    DD  SYSOUT=*                                   
    //SORTIN DD *                                               
    111
    222
    333                                                                                                   
     //*SORTOUT DD SYSOUT=*                                     
    //SORTOUT  DD DSN=**.****.OUTPUT2,                         
    //            DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(5,5),RLSE)
    //SYSIN    DD    *                                         
      OPTION COPY                                               
      OUTFIL REPEAT=3,OVERLAY=(50:SEQNUM,5,ZD)                 
    /*                                 
    //STEP030 EXEC PGM=SORT                                 
    //SYSOUT DD SYSOUT=*                                     
    //SORTJNF1     DD DISP=SHR,DSN=**.****.OUTPUT1           
    //SORTJNF2     DD DISP=SHR,DSN=**.****.OUTPUT2           
    //SORTOUT DD DSN=**.****.OUTPUT3,DISP=(NEW,CATLG,DELETE),
    //           SPACE=(CYL,(10,10),RLSE)                   
    //SYSIN DD *                                             
      JOINKEYS F1=SORTJNF1,FIELDS=(50,5,A),SORTED           
      JOINKEYS F2=SORTJNF2,FIELDS=(50,5,A),SORTED           
      REFORMAT FIELDS=(F1:1,3,F2:1,3,F1:7,9)               
      SORT FIELDS=COPY                                       
    /*                         



Please tell me how should I proceed with this using DFSORT. I want to know of something which picks one record from the second input file and executes the job. After that, again it picks the second record and executes it. I am also open to any new methods of achieving this.
neverfail2try
 
Posts: 5
Joined: Sun Mar 31, 2013 1:57 am
Has thanked: 3 times
Been thanked: 0 time

Re: DFSORT for taking records one by one

Postby NicC » Sun Mar 31, 2013 3:20 am

Please do not double post in this, or any other forum. Locked.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post