thanks bill,
while i was trying your suggestion, I was not able to do the sum in joinkey subtask JNF1CNTL,was getting error as sort fields not supported in joinkey subtask,if you have any sample card for this pls let me know.
and in the meantime i got a simpler solution for my problem.
Code:
//STEP EXEC SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AA
AA
BB
// DD *
AA
BB
CC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION ZDPRINT
INREC FIELDS=(1,2,X,C'000001')
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=(4,6,ZD)
OUTREC BUILD=(1,3,4:(4,6,ZD,SUB,+1),EDIT=(TTTTTT))
OUTFIL REMOVECC,BUILD=(1,2,C',''',4,6,C'''',80:X),
TRAILER1=('TO',C',''',TOT=(4,6,ZD,TO=ZD,LENGTH=6),C'''',80:X)
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Can you post the full sysout for the error on JNF1CNTL, please?
With your new solution, don't you get "extra" records counted from the second file? And what about the format of the leading zeros which you wanted? And where has your "zero" record gone for C? (these are all inter-connected).
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE417I 0 THIS IS THE JOINKEYS F1 SUBTASK FOR SORTJNF1
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 11:59 ON WED
OPTION ZDPRINT
INREC FIELDS=(1,2,X,C'000001')
SORT FIELDS=(1,2,CH,A)
ICE427A 0 SORT STATEMENT CANNOT BE USED WITH JOINKEYS SUBTASK
ICE751I 0 C5-K76982 C6-K90026 E7-K70685
ICE146I 1 END OF STATEMENTS FROM JNF1CNTL - PARAMETER LIST STATEMENTS FOLLOW
ICE052I 3 END OF DFSORT
for extra record ,i am using the SUBstract,i would get the o/p as