View previous topic :: View next topic
|
Author |
Message |
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
I have to hard code +99999999999999.99 to a field in packed decimal format.
Can you please let me know how to do this.
I have tried the below method , but it works if the value is without decimal.
SORT FIELDS=(1,10,CH,A)
INREC FIELDS=(1,10,+999999999999999,PD,LENGTH=8) |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
PD fields do not have a decimal point. The program reading or writing the field must know where the point is.
For example, if a packed field contains X'0123456F', it will be interpreted by a program as:
123.456 if the program defines the field as PIC 9(4)V9(3) COMP-3
1234.56 if the program defines the field as PIC 9(5)V9(2) COMP-3
0.123456 if the program defines the field as PIC 9V9(6) COMP-3 |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Brit,
i encountered a similar situation in recent time. I need to insert 4.1 into the attribute defined as PD.
I used the following sort card for that.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,11,X'00410C',12,68)
/* |
Hope the explanation given by marso is sufficient.
Marso,
Pretty neat explanation buddy. |
|
Back to top |
|
|
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
I have tried with the Hex value. It is working fine.
Thanks a lot |
|
Back to top |
|
|
|