View previous topic :: View next topic
|
Author |
Message |
jvsamycts
New User
Joined: 15 May 2008 Posts: 4 Location: Chennai
|
|
|
|
Hi... My requirement is to create an output file in the following format.
Date : 11/03/2009
Count : XXXXXXXXX
Input file will have date at the very first record (position 60 to 67 - CCYYMMDD format).
i.e first record will be date record and remaining records are detail recs. I need the date and count of detail recs in the above format. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi ,
below step will give you desired output.
Assumed input and output LRECL=80.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=your input dataset
//OUT DD DSN=outputdatasetname,DISP=(MOD,CATLG,DELETE),
// LRECL=80
//TOOLIN DD *
SUBSET FROM(IN1) TO(OUT) KEEP INPUT FIRST USING(CTL1)
COUNT FROM(IN1) WRITE(OUT) TEXT('COUNT:') DIGITS(9) WIDTH(80) SUB(1)
/*
//CTL1CNTL DD *
OPTION COPY
INREC BUILD=(C'DATE :',66,2,C'/',64,2,C'/',60,4,80:X)
/*
|
|
|
Back to top |
|
|
jvsamycts
New User
Joined: 15 May 2008 Posts: 4 Location: Chennai
|
|
|
|
Thanks Sambhaji.... But i need to attain this using SORT.... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ICETOOL is part of the DFSORT product |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
jvsamycts,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
HEADER1=('DATE : ',64,2,C'/',66,2,C'/',60,4),
TRAILER1=('COUNT : ',COUNT)
//* |
|
|
Back to top |
|
|
|