IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT for signed numeric edit values


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Tue Feb 27, 2007 10:54 am
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Feb 27, 2007 11:09 am
Reply with quote

Hi There,

Ur question is not clear.
Would u please explain it ?
How u got A 000000345-00000035000.00 ?
Back to top
View user's profile Send private message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Tue Feb 27, 2007 11:20 am
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Feb 27, 2007 11:44 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 27, 2007 10:01 pm
Reply with quote

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
View user's profile Send private message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Tue Mar 20, 2007 10:48 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 20, 2007 8:18 pm
Reply with quote

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
View user's profile Send private message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Mon Mar 26, 2007 12:55 pm
Reply with quote

Is there any other way we can do this task.
Please let me know.
Thanks in advance.






With Regards
Rupa
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 26, 2007 8:45 pm
Reply with quote

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
View user's profile Send private message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Tue Mar 27, 2007 9:14 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 27, 2007 8:36 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top