IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Handling Sign


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srimsc_ibmmainframes

New User


Joined: 17 Feb 2004
Posts: 19
Location: pune

PostPosted: Wed Oct 26, 2005 11:21 am
Reply with quote

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
View user's profile Send private message
maggiebms

New User


Joined: 23 May 2005
Posts: 16

PostPosted: Wed Oct 26, 2005 2:17 pm
Reply with quote

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
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Wed Oct 26, 2005 5:02 pm
Reply with quote

01 WS-NUM PIC S9(10).
Move string to WS-NUM.

let me know if i am wrong...

Thanks,
Kumar.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Oct 28, 2005 4:43 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts File Handling COBOL Programming 9
No new posts Handling the numeric data in unstring... COBOL Programming 18
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
This topic is locked: you cannot edit posts or make replies. regarding COBOL WRITE verb (VB File H... COBOL Programming 9
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
Search our Forums:

Back to Top