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

help needed in addition of 4 PD fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Wed Aug 26, 2009 9:02 pm
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
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 Developer


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

PostPosted: Thu Aug 27, 2009 9:24 pm
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:

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
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 Developer


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

PostPosted: Tue Sep 01, 2009 10:47 pm
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:

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Mainframe profiles needed @ Cognizant Mainframe Jobs 0
Search our Forums:

Back to Top