View previous topic :: View next topic
|
Author |
Message |
srimsc_ibmmainframes
New User
Joined: 17 Feb 2004 Posts: 19 Location: pune
|
|
|
|
Hi
I am getting a 11 bytes string, plz note that i may get '+' or '-' sign as the first char as part of the String, my requirement is i have to move this to a numeric field at the same time i have to handle the incoming Sign('+' or '-')
So how can i handle this sign in my pgm...? |
|
Back to top |
|
|
maggiebms
New User
Joined: 23 May 2005 Posts: 16
|
|
|
|
Hi
Plz use the cobol logic to move the sign here.
PERFORM s1 varying i from 1 by 1 until i> lengh(str)
s1.
if(str(i:1) = "+" or "-") then
move str(i:1) to temp.
Regards,
Maggie |
|
Back to top |
|
|
ikumar
New User
Joined: 02 Aug 2005 Posts: 81
|
|
|
|
01 WS-NUM PIC S9(10).
Move string to WS-NUM.
let me know if i am wrong...
Thanks,
Kumar. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Reddy,
I answered this ques in the VS COBOL forum (see link below). Doesn't it serve your needs? The courtesy of a reply would have been helpful to you and others here @ IBM M/Fs.
ibmmainframes.com/viewtopic.php?t=6418 |
|
Back to top |
|
|
|