View previous topic :: View next topic
|
Author |
Message |
sumitmalik29 Warnings : 1 New User
Joined: 10 Feb 2008 Posts: 19 Location: bhuneswar
|
|
|
|
Hi
i need to change the packed decimal format to character format, during a sort step
for example below record in comp-3
....äæ............á&....
needs to be changed to character format
Thanks in advance |
|
Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sumitmalik29,
What is the position and length of the packed decimal number? How do you want the readable format? (1.234 or 1234 or 12.34 or 123.4 ? ...)
Also what is the LRECL and RECFM of input and output files? |
|
Back to top |
|
 |
sumitmalik29 Warnings : 1 New User
Joined: 10 Feb 2008 Posts: 19 Location: bhuneswar
|
|
|
|
hi sukolu
the position of column is from 43 to 48 and is of length 2 bytes for packed decimal
i just want to display the result in character format,
ex:- character format would be '2008' if it is 2 byte data
just want to know the syntax
Thanks |
|
Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sumitmalik29 wrote: |
hi sukolu
the position of column is from 43 to 48 and is of length 2 bytes for packed decimal
i just want to display the result in character format,
ex:- character format would be '2008' if it is 2 byte data
just want to know the syntax
Thanks |
I think you should show some of the data in hex format. A 2 byte packed decimal field would be 3 digits and a sign and 43 to 48 would be 6 bytes! |
|
Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
 |
sumitmalik29 Warnings : 1 New User
Joined: 10 Feb 2008 Posts: 19 Location: bhuneswar
|
|
|
|
sorry,
below statement
"the position of column is from 43 to 48 and is of length 2 bytes for packed decimal"
was at typo mistake in hurry,
i used the following control statement for changing columns (in PD) from 43 to 48
OUTREC FIELDS=(43,6,PD,EDIT=('TTTTTTTTTTT'),SIGN=('+','-'))
here starting position is 43 and is of length 6 bytes for PD, on changing to character(using EDIT keyword) it expanded to 12 bytes, the last digit is reserved for sign
Thanks to all |
|
Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
That EDIT mask will not give you the sign since you only have Ts (digits) in the pattern and not an S for the Sign. You have SIGN=(+,-) for the leading signs, but no S for the actual sign.
If you want a leading sign, use:
Code: |
OUTREC FIELDS=(43,6,PD,EDIT=(STTTTTTTTTTT),SIGN=(+,-))
|
If you want a trailing sign, use:
Code: |
OUTREC FIELDS=(43,6,PD,EDIT=(TTTTTTTTTTTS),SIGN=(,,+,-))
|
Note that you don't need the apostrophes, although you can use them if you like. |
|
Back to top |
|
 |
|