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
 

 

sum of packed field

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

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Thu May 27, 2010 10:06 pm    Post subject: sum of packed field
Reply with quote

I'm trying to sum all the value in a file and display in sysout. The field starts at position 964 and has a (COBOL) definition as S9(12)V9(6). I'm using following sort card for getting the totals in this column 964, sortout is coming out blank.

Code:

  OPTION COPY                             
  OUTFIL REMOVECC,NODETAIL,                   
        TRAILER1=(964:TOT=(964,10,PD,TO=PD))
Back to top
View user's profile Send private message

raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Thu May 27, 2010 10:18 pm    Post subject:
Reply with quote

Just to add my input file is not empty and data type of field is comp-3.I missed that adding initially
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 27, 2010 10:21 pm    Post subject: Reply to: sum of packed field
Reply with quote

raghavmcs,

Your output total is also a 16 byte PD field which you cannot see in normal mode. You need to type HEX ON and look at the contents of it in pos 964.
Back to top
View user's profile Send private message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Thu May 27, 2010 10:24 pm    Post subject:
Reply with quote

Thanks,what change I should make in my jcl to get that normally...I think we have keywork,sorry not frequently use them wiht dfsort..!!!
and yes Inow see it on 964 in packed.
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 May 27, 2010 10:24 pm    Post subject:
Reply with quote

Your result would be a 16-byte PD field starting in position 964.

PD fields are NOT readable (e.g. a 10-byte PD value might be X'0000000000000000501C' which would not be displayed as anything you could read directly), so to see the actual output, you would have to display it in hex or convert it back to character.

Also, do you really want the output value at position 964 rather than at position 1?
Back to top
View user's profile Send private message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Thu May 27, 2010 10:29 pm    Post subject:
Reply with quote

Thanks I changed TRAILER1=(964:TOT=(964,10,PD,TO=PD)) to
TRAILER1=(1:TOT=(964,10,PD,TO=PD)) and now I can see sum in position 1 with hex on
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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