View previous topic :: View next topic
|
Author |
Message |
achittu
New User
Joined: 26 Feb 2007 Posts: 14 Location: chennai
|
|
|
|
I have a three byte alphanumeric field which contains 6 digit date ( DDMMYY format)
Now I need to unpack the packed 6 digit date value from the 3 byte alpha numeric field and move it to a display format. Currently I cannot view it since it is in packed mode. I do not know whether it is Binary or Comp - 3
but when I view in File Aid in normal mode ( NOT HEX mode) , I see the value as X'290910' ( represents date value of 290910) now I want this value of 290910 move to a display format field.
I tried using the below sort
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,359,360:360,3,PD,TO=ZD,LENGTH=6,366:363,531)
|
Here 360 onwards 3 byte field contains the date field. This Sort does not give me the correct value of 290910. Instead it gives me 029091. I have tried giving BI ( binary) instead of PD but still does not give me the desired results.
Not sure where I went wrong. Can you suggest appropriate sort step for achieving the above |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
X'290910' is NOT PD so you can't use PD to display it.
You can use HEX like this:
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,359,360:360,3,HEX,366:363,531)
|
|
|
Back to top |
|
|
achittu
New User
Joined: 26 Feb 2007 Posts: 14 Location: chennai
|
|
|
|
Thanks a lot Frank. It is working as desired |
|
Back to top |
|
|
|