View previous topic :: View next topic
|
Author |
Message |
sudhakar1979
New User
Joined: 23 Aug 2005 Posts: 24
|
|
|
|
Hi,
I have below situation.
the input vsam file is as below.
Code: |
1 2 3 4 5
....5....0....5....0....5....0....5....0....5....0
0000000001 000581004 2000 1000 2000 3000
0000000001 000581004 4482 2000 3000 4000
0000000002 000456835 4000 3000 4000 5000
0000000002 000456835 5000 4000 5000 4000
0000000003 000235424 3482 5000 6000 7000 |
in the above layout first 10 bytes are sequence number (0000000001,0000000002 and 0000000003) and next nine bytes are identification number(000581004,000456835,000235424) and next 4 bytes are amount1(20.00,44.82,40.00,50.00,34.82) and next 4 bytes are amount2(10.00,20.00,30.00,40.00,50.00) and next 4 bytes are amount3(20.00,30.00,40.00,50.00,60.00) and next 4 bytes are amount4(30.00,40.00,50.00,40.00,70.00)
I want to add the amounts if we have same sequence number and identification number.
the o/p file should be like this.
0000000001 000581004 6482 3000 5000 7000
0000000002 000456835 9000 7000 9000 9000
0000000003 000235424 3482 5000 6000 7000
Regards,
Sudhakar. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
sudhakar1979
New User
Joined: 23 Aug 2005 Posts: 24
|
|
|
|
in the last week post I was asked to add only one column. in this requirement i suppose to add 4 columns. am not sure how to do this. I tried with putting the new columns with the earlier post. it is not working. just want to find out to do this. thanks for the reply. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I tried with putting the new columns with the earlier post. it is not working. |
What did you try? What happened?
IMHO, you will learn much more if you work thru the requirement rather than simply have someone else "sling code" for you. . .
If you post what you tried and the problem(s) encountered, the IBMer's will surely be able to clarify |
|
Back to top |
|
|
sudhakar1979
New User
Joined: 23 Aug 2005 Posts: 24
|
|
|
|
//SYSIN DD *
SORT FIELDS=(1,10,A,11,9,A),FORMAT=CH
SUM FIELDS=(20,4,ZD,25,4,ZD)
OUTREC OVERLAY=(20:20,4,25:25,4,ZD,EDIT=(TTTT))
/*
i modified the sysin card like this. am getting SYSTEM COMPLETION CODE=0C7. |
|
Back to top |
|
|
sudhakar1979
New User
Joined: 23 Aug 2005 Posts: 24
|
|
|
|
i got the o/p. thanks for the postings.
Dick: I am also working on this. meanwhile if i get the reply for this postings that would be good right? for that i have posted my questions.
thank you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I "Coded" your data and added "Cols" and the data does not appear to match the sort control specification for the field. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sudhakar1979,
Given that your input data looks like this:
Code: |
00000000010005810042000100020003000
00000000010005810044482200030004000
00000000020004568354000300040005000
00000000020004568355000400050004000
00000000030002354243482500060007000
|
The following DFSORT job would give you what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... VSAM input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
RECORD TYPE=F
OPTION ZDPRINT
SORT FIELDS=(1,19,CH,A)
SUM FIELDS=(20,4,ZD,24,4,ZD,28,4,ZD,32,4,ZD)
/*
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
meanwhile if i get the reply for this postings that would be good right? |
Yup, good luck
Hopefully, we will hear of success
d |
|
Back to top |
|
|
sudhakar1979
New User
Joined: 23 Aug 2005 Posts: 24
|
|
|
|
thank you Frank for the reply. Could you please explain what is the OPTION ZDPRINT. If i dont mention this option also i am getting the accurate results.
Thanks in Advance.
Sudhakar. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The ZDPRINT option ensures that an F sign is used for positive summed ZD values which makes them displayable (e.g. X'F1F2F3' = C'123' vs X'F1F2C3' = C'12C'). If you get the same results without ZDPRINT, then your site has ZDPRINT=YES as the installation default. |
|
Back to top |
|
|
|