How to add packed decimal rows and display in decimal format
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: How to add packed decimal rows and display in decimal format Author: mfuser9099 PostPosted: Thu Feb 03, 2005 10:03 am
    —
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

#2:  Author: programmer1 PostPosted: Thu Feb 03, 2005 10:09 am
    —
mfuser9099,

Can you post your question more clearly. It will help if you could post the input dataset and the desired output dataset.

#3:  Author: Frank YaegerLocation: San Jose PostPosted: Thu Feb 03, 2005 11:03 am
    —
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.



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group