View previous topic :: View next topic
Author
Message
nitinkhobragade1 New User Joined: 07 Mar 2006Posts: 16
Hi,
I want to count the number of records in a file and put that count in an output file.The output file should have only one record mentioning the record count.
The records format should be:
'The total number of records in the input file is:' count.
How can i do this using Syncsort?
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
I think yes.
Infil a constant of one.
Sum on that constant.
Outfil reformatting the summed total into your phrase.
Have you checked your manual for the specifics?
Back to top
guptae Moderator Joined: 14 Oct 2005Posts: 1208 Location: Bangalore,India
Hi there,
You can use following sort card to find number of records
Code:
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)
/*
Its not the optimized one but u will get result
Back to top
nitinkhobragade1 New User Joined: 07 Mar 2006Posts: 16
Hi Ekta,
I have used your control card in the below jcl but the job is abending with maxcc=16
Code:
//STEP0110 EXEC PGM=SYNCSORT
//SORTIN DD DSN=TEST.RPT.FILE22,
// DISP=SHR
//SORTOUT DD DSN=TEST.RPT.FILE24,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSALLDA,
// DATACLAS=MEDIUM1,
// DCB=(LRECL=90,RECFM=FB,BUFNO=25)
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
it is erroring "ALTERNATE PARM USED" "SORTOF1 NOT DEFINED"
could you please suggest me what need to be done?
Regards,
Nitin
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
This
Code:
OUTFIL FILES=1,ENDREC=1,OUTREC(81,8,80:X)
tells the sort to use SORTOF1.
If you change your SORTOUT DD to SORTOF1 DD or if you change the OUTFIL to FILES=OUT, i believe you will fix your problem. They need to be in sync.
Back to top
Please enable JavaScript!