View previous topic :: View next topic |
Author |
Message |
ssanthosh Beginner
Joined: 19 Mar 2007 Posts: 13 Topics: 5
|
Posted: Thu Nov 13, 2008 4:47 pm Post subject: Changing the sign byte and assumed decimal to char |
|
|
We have a dataset where the signed byte is declared as S9(13)V9(02). When we ftp this file to windows server the data is not in readable format.
Our aim is to convert the Amount field S9(13)V9(02) to character format X(13).X(2) and then ftp to the server. Is there anyway to we can do this using SORT. I tried ICETOOL but could not get the expected result. The amount field appears starting from 895the position in the input file. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Nov 13, 2008 5:02 pm Post subject: |
|
|
ssanthosh,
A Field defined as S9(13)V9(02) is a 15 byte zoned decimal field with the sign punched on the last byte
Code: |
{ABCDEFGHI}JKLMNOPQR
CCCCCCCCCCDDDDDDDDDD
01234567890123456789
|
Hex C0 thru C9 are positive numbers and D0 thru D9 are negative numbers.
You can change S9(13)V9(02) to X(13).X(2) , but you also need another byte to differentiate between positive and negative numbers. So the total number of digits will be 17 if you want all the 13 + 2 digits of the number. If you think the number wont exceed 11+2 digits then you can convert it to SX(11).X(2), You can use the following control cards. P stands for the position where your numeric field starts
Code: |
OUTREC OVERLAY=(P:P,15,ZD,EDIT=(STTTTTTTTTTT.TT),SIGNS=(+,-)) |
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ssanthosh Beginner
Joined: 19 Mar 2007 Posts: 13 Topics: 5
|
Posted: Fri Nov 14, 2008 10:10 am Post subject: |
|
|
Thank you kolusu. It worked. |
|
Back to top |
|
|
|
|