Page 1 of 1

DFSORT - Convert CH to PD

PostPosted: Thu Jan 31, 2008 8:01 pm
by shwetss
Hi,
I need to convert a character field of 8 bytes to PD/BI, for summing up.
The file format is as follows:
1 - 42 --> CH
43 - 50 --> CH - need to convert this field
51 - 64 --> CH

Can you please help me solve it using DFSORT/ICETOOL?
Thanks!

Re: DFSORT - Convert CH to PD

PostPosted: Fri Feb 01, 2008 12:28 am
by dick scherrer
Hello,

Do you really need to convert data formats or do you just need to "sum" that field?

If you only need to sum the field, you can define the field as ZD and proceed.

Are you usng COBOL or the SORT (this is posted in the COBOL part of the forums)?

Re: DFSORT - Convert CH to PD

PostPosted: Fri Feb 01, 2008 12:52 pm
by arunprasad.k
How can you convert a character (I assume that it has non-numeric values) to a Packed deciamal?

If you want to convert Numeric fields to Packed deciamals, use the chapter 2.4.7 in the below link.

It has some fine examples. Also you can refer to 2.4.8 for using edited variables.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/CCONTENTS

Use ZD if your input has only numeric fields.

Arun.