MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
yadav2005 Intermediate Joined: 10 Jan 2005 Posts: 348 Topics: 144
Posted: Wed Aug 11, 2010 10:04 am Post subject: forming output file with mutiple steps based on input record
Hi,
Based on my input file I need to generate an output file containing mutiple steps , if my input files is below , then i want the output as below
Code:
//STEP010 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABC,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//STEP020 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DEF,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//STEP030 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=PQR,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//STEP040 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XYZ,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
If my input file is below ,
then output file should be
Code:
//STEP010 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABC,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//STEP020 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DEF,DISP=SHR
//SORTOUT DD DSN=YYY,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
Back to top
Nic Clouston Advanced Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Wed Aug 11, 2010 10:16 am Post subject:
You either have to give your output files different names (preferred) or DISP=MOD otherwise you will end up with only the output from the last copy. So, which do you want? And if the first, then what naming convention? _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
yadav2005 Intermediate Joined: 10 Jan 2005 Posts: 348 Topics: 144
Posted: Wed Aug 11, 2010 10:26 am Post subject:
Nic,
I will tailor once the JCL with steps is created and I understand your point the files will be overwritten with the last copy of the data.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12383 Topics: 75 Location: San Jose
Posted: Wed Aug 11, 2010 10:29 am Post subject:
yadav2005 wrote: I will tailor once the JCL with steps is created and I understand your point the files will be overwritten with the last copy of the data.
yadav2005 ,
*sigh* Use the following DFSORT JCL.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
DEF
PQR
XYZ
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL BUILD=(C'//STEP',SEQNUM,3,ZD,START=10,INCR=10,
C' EXEC PGM=SORT',/,
C'//SYSOUT DD SYSOUT=*',/,
C'//SORTIN DD DISP=SHR,DSN=',1,44,/,
C'//SORTOUT DD DSN=YOUR OUTPUT 44 BYTE DSN NAME,',/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// UNIT=SYSDA,',/,
C'// SPACE=(CYL,(X,Y),RLSE)',/,
C'//SYSIN DD *',/,
C' SORT FIELDS=COPY',/,
C'//*',80:X)
//*
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
yadav2005 Intermediate Joined: 10 Jan 2005 Posts: 348 Topics: 144
Posted: Wed Aug 11, 2010 11:03 am Post subject:
Kolusu,
Thanks for your code it helped me.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum