View previous topic :: View next topic
|
Author |
Message |
Anithals
New User
Joined: 23 Jun 2006 Posts: 5
|
|
|
|
We need the following:
Input file has a packed decimal field which is S9(6) PACKED DECIMAL.
The output also should have the same declaration.
Input file has 4 bytes length and the output file should have 2 bytes.
For eg : Input has a record value 31000
the output file should have value 031.
Both of them should be packed decimal / COMP-3 only.
Can anyone help in this regard.
Thanks in advance.
Regards,
Anitha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Are you saying you have a 4-byte PD field with 6 digits and you want to divide it by 1000 to get a 2-byte PD field with 3 digits?
You say input and output should have the same declaration, but then you say the input has 4 bytes, and the output should have 2 bytes ... that seems like a contradiction. If the output is only 2 bytes, it can't have S9(6) PACKED DECIMAL as its declaration since that takes 4 bytes. It could have S9(3) PACKED DECIMAL.
Please clarify what you want. |
|
Back to top |
|
|
Anithals
New User
Joined: 23 Jun 2006 Posts: 5
|
|
|
|
Hi,
I will rephrase the question.
The input and output should have the declaration S9(6) packed decimal.
But the value should change.
For eg: 31000 to 031
Please suggest.
Regs,
Anitha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use these DFSORT control statements:
Code: |
OPTION COPY
INREC OVERLAY=(1:1,4,PD,DIV,+1000,TO=PD,LENGTH=4)
|
If your input record has X'0031000C', your output record will have X'0000031C'. |
|
Back to top |
|
|
Anithals
New User
Joined: 23 Jun 2006 Posts: 5
|
|
|
|
Hi,
Thanks. Its working now.
Regs,
Anitha |
|
Back to top |
|
|
|