MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
relaxing Beginner Joined: 25 Aug 2003 Posts: 73 Topics: 29
Posted: Thu Sep 23, 2004 3:41 am Post subject: Remove multiple footers from this sort...
Hello Kolusu
Back to the old problem...
Below code gives me many footers (as many lines as in the input file). Is there a way to retain only the last footer..?
Code: //STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INFILE1,
// DISP=SHR
//OUT DD DSN=OUTFILE1,
// AVGREC=K,
// RECFM=FB,
// LRECL=01600,
// DISP=(MOD,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) USING(CTL2)
COPY FROM(IN) USING(CTL3)
//CTL1CNTL DD *
OPTION STOPAFT=1
OUTFIL FNAMES=OUT,OUTREC=(C'XXHEADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' XXXXXX ',C'999999',DATE1,TIME1,
1600:X)
//CTL2CNTL DD *
OMIT COND=(3,4,SS,EQ,C'HEAD,FOOT')
OUTFIL FNAMES=OUT
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(C'XXFOOTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' xxxxxx ',C'999999',SEQNUM,8,ZD,1600:X)
/*
If the input file has 5 details lines then the output looks like;
Head
DT1
DT2
DT3
DT4
DT5
foot1
foot2
foot3
foot4
foot5
Regards, Relaxing..
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Thu Sep 23, 2004 5:58 am Post subject:
relaxing,
I don't remember your old problem. The last copy operator in your job shown here is just initializing ALL RECORDS with some predefined valued.
If I understand correctly do you want the output to look like this?
Code:
XXHEADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ..
DT1
DT2
DT3
DT4
DT5
XXFOOTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ...
If that is what you want then change your CLT3CNTL to the following.
Code:
//CTL3CNTL DD *
INCLUDE COND=(3,4,CH,EQ,C'FOOT')
OPTION STOPAFT=1
OUTFIL FNAMES=OUT,
OUTREC=(C'XXFOOTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' xxxxxx ',C'999999',SEQNUM,8,ZD,1600:X)
/*
If it is different then please show me a sample input and desired output along with the DCB Parameters and postion of the header and footer.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
relaxing Beginner Joined: 25 Aug 2003 Posts: 73 Topics: 29
Posted: Thu Sep 23, 2004 10:09 am Post subject:
Sorry Kolusu...
Here's the required info...
The input file has only detail lines like:
Infile;
Code: DT1
DT2
DT3
DT4
DT5
The sorted outfile should be
Quote: HEAD
DT1
DT2
DT3
DT4
DT5
FOOT5 /*here 5 is total number of detail lines */
With the current code ( in the first post ) I get output as:
Code: HEAD
DT1
DT2
DT3
DT4
DT5
FOOT1
FOOT2
FOOT3
FOOT4
FOOT5 /*I want only this line */
Regards, Relaxing...
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Thu Sep 23, 2004 10:55 am Post subject:
Relaxing,
Try this JCL.
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//OUT DD DSN=YOUR OUTPUT FILE,
// DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,1),RLSE)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) TO(OUT)
COPY FROM(IN) USING(CTL2)
//CTL1CNTL DD *
OPTION STOPAFT=1
OUTFIL FNAMES=OUT,
OUTREC=(C'XXHEADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' XXXXXX ',C'999999',DATE1,TIME1,
1600:X)
//CTL2CNTL DD *
OPTION STOPAFT=1
OUTFIL FNAMES=OUT,
OUTREC=(C'XXFOOTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' XXXXXX ',C'999999',DATE1,TIME1,
1600:X)
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
relaxing Beginner Joined: 25 Aug 2003 Posts: 73 Topics: 29
Posted: Thu Sep 23, 2004 11:03 am Post subject:
Kolusu I tried this already. I had to abandon this as it gives me the first FOOTer (FOOT1) line...i.e., the output becomes:
Quote: HEAD
DT1
DT2
DT3
DT4
DT5
FOOT1 /*I need the FOOT5 though*/
But the output I need is:
Quote: HEAD
DT1
DT2
DT3
DT4
DT5
FOOT5 /*here 5 is total number of detail lines */
Regards,Relaxing..
Back to top
relaxing Beginner Joined: 25 Aug 2003 Posts: 73 Topics: 29
Posted: Thu Sep 23, 2004 11:09 am Post subject:
Kolusu, I cannot edit the previous post but I would like to add this...your code will not give me the total number of detail lines in the FOOT(er) record..
But I need the total number of detail lines in the FOOT(er) line..
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Thu Sep 23, 2004 1:19 pm Post subject:
Relaxing,
This is actually a simple job which you complicated with your first post.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,1600,SEQNUM,8,ZD)
OUTFIL REMOVECC,
OUTREC=(1,1600),
HEADER1=(C'XXHEADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' XXXXXX ',C'999999',DATENS=(4MD),TIMENS=(24)),
TRAILER1=(C'XXFOOT',1601,8,
C'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
C' XXXXXX ',C'999999',DATENS=(4MD),TIMENS=(24))
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
relaxing Beginner Joined: 25 Aug 2003 Posts: 73 Topics: 29
Posted: Fri Sep 24, 2004 12:47 am Post subject:
Thanks Kolusu...
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