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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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