replacing diff value in a copy of input rec



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

replacing diff value in a copy of input rec

Postby whowillwait4u » Thu Mar 01, 2012 7:48 pm

Hi,

My input is present as shown below

Test.File&line..Valfile
Test.File&line..Srtfile


output should be:

Test.File1.Valfile
Test.File2.Valfile
Test.File3.Valfile
Test.File4.Valfile
Test.File1.Srtfile
Test.File2.Srtfile
Test.File3.Srtfile
Test.File4.Srtfile


I mean to say when ever I find "&line." in my input record then total 4 records should copy to output file by replacing &line. as 1,2,3,4.
whowillwait4u
 
Posts: 15
Joined: Fri Feb 17, 2012 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: replacing diff value in a copy of input rec

Postby skolusu » Thu Mar 01, 2012 9:29 pm

Use the following DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
TEST.FILE&LINE..VALFILE                                       
TEST.FILE&LINE..SRTFILE                                       
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  OPTION COPY                                                 
  INCLUDE COND=(1,80,SS,EQ,C'&LINE.')                         
                                                             
  OUTFIL REPEAT=4,IFOUTLEN=80,IFTHEN=(WHEN=INIT,             
  PARSE=(%01=(ENDBEFR=C'&LINE.',FIXLEN=44),%02=(FIXLEN=44)), 
  BUILD=(%01,X,%02)),                                         
  IFTHEN=(WHEN=GROUP,RECORDS=4,PUSH=(45:SEQ=1)),             
  IFTHEN=(WHEN=INIT,BUILD=(1,89,SQZ=(SHIFT=LEFT)))           
//*
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post