View previous topic :: View next topic
|
Author |
Message |
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
My input looks like this.
A 000033154-00000010000.00
A 000002340-00000030000.00
A 000001230 00000010000.00
A 000000345-00000005000.00
and output should be
A 000000345-00000035000.00
I tried but was not able to add considering the sign.
Please advise the logic using DFSORT for the above scnario.
Thanks in advance
With Regards
Rupa... |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Ur question is not clear.
Would u please explain it ?
How u got A 000000345-00000035000.00 ? |
|
Back to top |
|
|
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
Actually i want to add third coulmn alone
Consider infile divided into 3 columns like this
A| 000033154|-00000010000.00
A| 000002340|-00000030000.00
A| 000001230| 00000010000.00
A| 000000345|-00000005000.00
Just for the readability i divided coulmns using "|".
I just want to add third coulm alone dont bother abt the 2 nd column.
When we add third cloumn we should get
A 000000345-00000035000.00
Hope i am clear now...
Please let me know if u can solve my problem...
Thanks in advance...
With Regards |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Rupa,
Code: |
SORT FIELDS=(1,1,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,1,
TRAILER3=(1,10,
11:TOT=(11,15,SFF,EDIT=(STTTTTTTTTTT.TT),SIGNS=(,-)))) |
I have not checked it . Let us know the result |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rupa,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A 000033154-00000010000.00
A 000002340-00000030000.00
A 000001230 00000010000.00
A 000000345-00000005000.00
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(1,11,
TOT=(12,15,SFF,EDIT=(STTTTTTTTTTT.TT),SIGNS=(,-)))
/*
|
For complete details on DFSORT's SFF format, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
Sorry to get back very late.
when i tried the above code it is showing error in SFF keyword with error code U0223.
Please advise on how to proceed.
Thanks in advance. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The ICE0223A message tells me that your site is way behind in DFSORT service. SFF requires DFSORT's Dec, 2004 PTF which you apparently don't have. Ask your System Programmer to install z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the available DFSORT function. |
|
Back to top |
|
|
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
Is there any other way we can do this task.
Please let me know.
Thanks in advance.
With Regards
Rupa |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Does every record always have the same value in position 1 (e.g. all of the records have A as in your example, or all of the records have some other value)? What is the RECFM and LRECL of the input file? |
|
Back to top |
|
|
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
Does every record always have the same value in position 1
(e.g. all of the records have A as in your example, or all of the records have some other value)?
No it varies from A to D ... I mean it can have A or B or C or D..
So i need to sum the third coulmn based on 1 st position value.
What is the RECFM and LRECL of the input file?
RECFM=FB & LRECL=080
With Regards
Rupa. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Without the Dec, 2004 PTF functions, that would require splitting the file into two files with OUTFIL INCLUDEs - one for the positive values and the other for the negative values, so you could remove the decimal point and convert each value to a positive or negative ZD value. Then you could bring the two files back together, get the totals for each key, and convert the values back to the form you want. You really should ask your System Programmer to install the April, 2006 PTF. |
|
Back to top |
|
|
|