View previous topic :: View next topic |
Author |
Message |
avid_lrner Beginner
Joined: 15 Apr 2005 Posts: 21 Topics: 9
|
Posted: Fri Jun 17, 2005 5:44 am Post subject: formatting characters |
|
|
Hi all,
Following is my input file:
Code: |
F1 F2 F3 F4 F5
------------- --- --- --- --------
AAAAAAAAAA 99 111 222 20030405
BBBBBBBBBB 99 222 0 20030405
CCCCCCCCC 98 333 0 20030405
DDDDDDDDD 96 -999 366 20040110
EEEEEEEEEEE 94 444 -999 20031010
|
This file basically contains all character values. Each field is separated by spaces.
Now coming to the requirement:
Have to convert fields 3 and 4, which have the format X(4) to
S9(5) COMP-3 values.
When i move the char value to a Numeric value, am getting the following output
Code: |
F1 F2 F3 F4 F5
------------- --- --- --- --------
AAAAAAAAAA 99 1110 2220 20030405
BBBBBBBBBB 99 2220 0 20030405
CCCCCCCCC 98 3330 0 20030405
DDDDDDDDD 96 -999 3660 20040110
EEEEEEEEEEE 94 4440 -999 20031010
|
Output:
Code: |
X(4) TO S9(5) COMP-3.
111_ TO 1110 (the trailing space is being converted to a zero).
222_ TO 2220 and so on.
|
Help needed!!!
regards,
avid_lrner.
[/code][/list] |
|
Back to top |
|
|
avid_lrner Beginner
Joined: 15 Apr 2005 Posts: 21 Topics: 9
|
Posted: Fri Jun 17, 2005 5:58 am Post subject: formatting characters |
|
|
Sorry for the awful indentation.
posted the query in a hurry.
regards,
avid_lrner. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|