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

sum of packed field


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


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

PostPosted: Thu May 27, 2010 10:24 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
Search our Forums:

Back to Top