View previous topic :: View next topic
|
Author |
Message |
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
I have the following input records to DFSORT:
RECFM=FB, LRECL=71
Code: |
ABENDAID ABENDAID.CICS*.**
ABENDAID ABENDAID.**
ABJ ABJ.**
ACI ACI.**
ACTP ACTP.**
ACTP ACTP.**
ADT0 ADT0.CIMS.**
ADT0 ADT0.CIMS.**
ADT0 ADT0.CIMS.**
ADT0 ADT0.CIMS.**
ADT0 ADT0.CIMS.**
ADT0 ADT0.**
ADT0 ADT0.**
ADT0 ADT0.**
|
I would like to sort these (10,44,CH,A), sum the occurences, and write the sum to position 55 of the output file. The output should resemble:
Code: |
ABENDAID ABENDAID.CICS*.** 00001
ABENDAID ABENDAID.** 00001
ABJ ABJ.** 00001
ACI ACI.** 00001
ACTP ACTP.** 00002
ADT0 ADT0.CIMS.** 00005
ADT0 ADT0.** 00003
|
The SUM'ed field can be in any number format if DFSORT is unable to use straight numbering.
Any assistance would be appreciated. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. You can format the count any way you like using the appropriate edit mask.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input (FB/71)
//SORTOUT DD DSN=... output (FB/71)
//SYSIN DD *
SORT FIELDS=(10,44,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(10,44,
TRAILER3=(10,44,55:COUNT=(M11,LENGTH=5)))
/*
|
|
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Worked perfect!
Thank you very much...Scott |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
This should work too:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input (FB/71)
//SORTOUT DD DSN=... output (FB/71)
//SYSIN DD *
INREC FIELDS=(1:1,54,55:C'00001',60:60,12)
SORT FIELDS=(10,44,A),FORMAT=CH
SUM FIELDS=(55,5,ZD)
/*
|
|
|
Back to top |
|
|
|