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
 

 

help needed in addition of 4 PD fields

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

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Wed Aug 26, 2009 2:56 pm    Post subject: help needed in addition of 4 PD fields
Reply with quote

Hi All,

I have the following requirement. There are four S9(11)V99 comp-3 fields in my input file.
i need to add all the these fields and write to my output file which is againa S9(11)V99 COmp-3 field.

Input field positions are:
Field1 : position 60
field 2 : position 67
field 3 : position 130
field 4: position 116

thanks.
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: Wed Aug 26, 2009 9:02 pm    Post subject:
Reply with quote

Do you want a total of each field (vertical total) or do you want a total of each set of four fields (horizontal total)? Where do you want the totals or total?

Please show an example of the records in your input file and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Back to top
View user's profile Send private message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Thu Aug 27, 2009 12:21 pm    Post subject: Reply to: help needed in addition of 4 PD fields
Reply with quote

I need a horizontal total. These four fields correspond to different amount fields. So the output file would carry a sum of all the amount fields int he input file. I have already given the starting positions of the fields. For my request, LRECL is 50 and RECFM is FB.

And the output amount filed would be starting from 37th position. I have got soem values to be populated for the position from 1 - 36.

awaiting reply...

thanks.
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: Thu Aug 27, 2009 9:24 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what I think you're asking for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB/50)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,36,
     37:60,7,PD,ADD,67,7,PD,ADD,116,7,PD,ADD,130,7,PD,TO=PD,LENGTH=7,
     50:X)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Tue Sep 01, 2009 6:08 pm    Post subject: Reply to: help needed in addition of 4 PD fields
Reply with quote

Hi,

Thanks for the reply. But i got a soc7 when i executed this. Please find below the sortcard which i have used.My output file is of 50 record length.
The first 8 characters are to be picked up from the input file.
Code:
//SYSIN    DD   *
    OPTION COPY
    INREC BUILD=(1,8,C'YTD PAST ACCUMULATION  ',3X,
         39:60,7,PD,ADD,67,7,PD,ADD,116,7,PD,ADD,130,7,PD,
         TO=PD,LENGTH=7,8X)
/*



Please let me know where i have gone wrong in the code.
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 Sep 01, 2009 10:47 pm    Post subject:
Reply with quote

An S0C7 would indicate an invalid PD value, so either:
1) Your PD fields are NOT in the positions you say they are or
2) Your PD fields are NOT the length you say they are or
3) You have an invalid PD value in one of the fields.

You can use the VERIFY function of DFSORT's ICETOOL to check for invalid PD values - see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/6.18?DT=20090527161936
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 0 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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