View previous topic :: View next topic
|
Author |
Message |
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Hi ,
I need to copy a COMP-3 value from input file to an output file as a character. COMP-3 value is declared as s9(9). Can you please let me know what to do.
Thanks,
Pavan. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Try this
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1,5,PD,EDIT=(SIIIIIIIIT),SIGNS=(,-))
|
Input used :
Code: |
.....
22222
2222C
.....
32222
2222D
|
Output :
Code: |
222222222
-322222222
|
|
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Thanks Manu,
I tried your sort card and come to know that some spaces will be coming in place of leading zeroes. I want to supress them.Is there any way we can change sort card and do that? |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Try this
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1,5,PD,EDIT=(STTTTTTTTT),SIGNS=(+,-)) |
|
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Hi Manu ,
In my input file value is x'00000123'. I need only '123' in output file. But I am getting ' 123'. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Where is the sign bit?
You said it is declared as S9(9) Comp-3 , so it can only be x'000000123C'
in which case you will get 0123 with my code will return '+000000123' |
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Its Because of confusion.
Thanks a lot Manu , I got It. |
|
Back to top |
|
|
|