MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to add packed decimal rows and display in decimal format

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mfuser9099
Beginner


Joined: 03 Feb 2005
Posts: 1
Topics: 1

PostPosted: Thu Feb 03, 2005 10:03 am    Post subject: How to add packed decimal rows and display in decimal format Reply with quote

Hi

I have 10 rows and one column is having the comp-3 data, I would like to add them and put the total in different dataset.

any help on this ......


Thx
Back to top
View user's profile Send private message
programmer1
Beginner


Joined: 18 Feb 2004
Posts: 138
Topics: 14

PostPosted: Thu Feb 03, 2005 10:09 am    Post subject: Reply with quote

mfuser9099,

Can you post your question more clearly. It will help if you could post the input dataset and the desired output dataset.
_________________
Regards,
Programmer
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 03, 2005 11:03 am    Post subject: Reply with quote

mfuser9099,

If I understand you correctly, you just want to add up a column of PD values and show the result in the output data set. Let's assume your PD field is in positions 11-14. You could use this DFSORT job to get your PD total.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(1:TOT=(11,4,PD,TO=PD,LENGTH=4))
/*


Note that you'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) to use TO=PD in TRAILER1. For complete details on all of the new DFSORT and ICETOOL functions in this PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

If you have DFSORT, but don't have the appropriate PTF installed, ask your System Programmer to install it (it's free).

Without the TO=PD support in the PTF, creating the PD total is more complicated, especially if it can be negative. You could use SUM to get the PD total and move it where you want it, but that would require a SORT rather than a COPY and you'd need to have a field in every record with the same value to SORT on.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group