View previous topic :: View next topic |
Author |
Message |
visa Beginner
Joined: 12 Sep 2006 Posts: 6 Topics: 5
|
Posted: Tue Feb 27, 2007 10:06 am Post subject: Need validation on this ... |
|
|
Hi all,i have to convert some hex variables present in a sequnetial file to normal values.....the copybook of the sequential file is like this...
01 td-total-accountnumber
05 td-co-no pic s9(05) comp-3.
05 td-branch pic s9(05) comp-3.
05 td-accno pic s9(11) comp-3.
I have written a cobol program where i'm reading this sequential file and moving this comp-3 values to the working-storage varaibles.I have declared the working-storage variables like this....
01 ws-co pic x(06)
01 ws-branch pic x(06)
01 ws-accno pic x(12)
After submitting my job, i'm getting wrong values in ws-co,ws-branch,ws-accno.I feel I have declared working storage varaibles wrongly.
Please validate the above variable declarations......(i cant give the screen shots of the input and output values as im working in client's machine..sorry) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Feb 27, 2007 10:17 am Post subject: |
|
|
I think if you search the forum you will find that you cannot go directly from packed decimal to character but have to go via unpacked eg S9(5). If, on the other hand, they are not really packed numbers - just hex data then character fields can hold anything from x'00' to x'ff' assigning no special meaning to the value so you could read the data straight into the character field. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|