View previous topic :: View next topic
|
Author |
Message |
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Hi,
I have a file with a field with length 3 bytes (starting position 2). The values in the file for this field is in unpacked format.
My need is to pack (comp-3 format) the values of the above field.
Thanks
Sumu |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sumueng,
Post a few sample input records and the expected output out of it. Also the LRECL/RECFM etc. |
|
Back to top |
|
|
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Sample input record
C1390000228
C1390000229
I need to pack the above values 228 and 229 in packed Zoned decimal format
Start position of above values of field is 9 and length is 3 |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I need to pack the above values 228 and 229 in packed Zoned decimal format |
I dont understand what you meant by this. I am not aware of packed zoned decimal format. Are you trying to convert a ZD field to PD? Or is it something else. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
packed Zoned decimal format |
There is no such data type. There is zoned-decimal and packed-decimal.
Post the output (in hex) you want from the input you posted. |
|
Back to top |
|
|
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
I am sorry. it was mispelled. I meant to say packed decimal
Sample input record
C1390000228
C1390000229
I need to pack the above values 228 and 229 in Packed Decimal Format (Comp-3) using SORT card
Start position of above values of field is 9 and length is 3
The output (in hex) for the above input records
C1390000228
CFFFFFFFFFF4444
313900002280000
C1390000229
CFFFFFFFFFF4444
313900002290000 |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sumueng,
You can use the TO=PD option to convert the ZD field to PD.
Code: |
OPTION COPY
OUTREC BUILD=(1,8,9,3,ZD,TO=PD,LENGTH=2) |
|
|
Back to top |
|
|
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Thanks for the Tip
Regarding the parameters 9 and 3 denotes starting position and length 3, Btw what is 1 and 8 indicate here.
let me know |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
It's the first 8 characters in your input file and has nothing to do with the PD conversion. You can modify the card as per your output layout. |
|
Back to top |
|
|
sumueng
New User
Joined: 27 Nov 2008 Posts: 37 Location: Cochin
|
|
|
|
Thnaks. it worked fine |
|
Back to top |
|
|
|