Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SORT card to add the field values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
puneetvirmani143

New User


Joined: 24 Jul 2007
Posts: 55
Location: noida

PostPosted: Tue Feb 19, 2008 7:50 pm    Post subject: SORT card to add the field values
Reply with quote

Hi All,
I am having a Input File. Can I write a SORT statement to calculate what is the total value of "Net Value" and "Billing Quantity" fields for month of Jan, Feb and March in the input file ?

Month fields start from 18th position and is of length 2 ."NetValue" field: starts at 84th position and total of length 9 (6 digits ,then a "." and then 2 digits ) ."Billing Quantity" starts start at position 93 and is of length 9.

As per my knowledge SORT statement don't recognize a "." . So I think we have to add the 6 decimal separately in one SORT step and 2 digits (after decimal) in another SORT step. Then add both of them manually to reach at the final figure.

Can anybody tell me the exact syntax for Sort card to add the field values ?

Thanks
Puneet
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 8:10 pm    Post subject:
Reply with quote

Have you looked int UFF & SFF?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 9:26 pm    Post subject:
Reply with quote

puneetvirmani143 wrote:
Hi ,
Thanks for your help.As pper you we can add decimal number but can I get the exact syntax for it ?

Thanks
Puneet
What have you attempted so far?
Back to top
View user's profile Send private message
puneetvirmani143

New User


Joined: 24 Jul 2007
Posts: 55
Location: noida

PostPosted: Tue Feb 19, 2008 9:32 pm    Post subject: Sum the Fields and to get a total
Reply with quote

Hi,
Below is the code I am using for my requirement but I am getting user abend S000 U0016 and message is INVALID INREC OR OUTREC STATEMENT OPERAND.

Code:

//SYSIN    DD  *
  OPTION ZDPRINT
     INREC OVERLAY=(84:84,9,UFF,TO=ZD,LENGTH=09,
           93:93,9,UFF,TO=ZD,LENGTH=09)
     SORT FIELDS=(18,2,CH,A)
     SUM FIELDS=(84,9,ZD,93,12,ZD)
     OUTREC OVERLAY=(84:84,9,ZD,EDIT=(TTTTTTT.TT),
           93:93,9,ZD,M10,LENGTH=9)

Can you tell me where I am wrong ?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Feb 19, 2008 9:36 pm    Post subject:
Reply with quote

How about providing the actual sysout containing the error?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Feb 19, 2008 10:26 pm    Post subject:
Reply with quote

puneetvirmani143,

The fact that you got the ICE104A message for those control statements indicates you do not have z/OS DFSORT V1R5 PTF UQ95213 or DFSORT R14 PTF UQ95213. That PTF has been available since Dec, 2004 so your site is way behind in DFSORT service. The control statements work fine with that PTF (except that you should have 93,9,ZD instead of 93,12,ZD in the SUM statement).

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 latest DFSORT function.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us