Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Handling Sign

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Handling Sign
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    Post subject: Re: Handling Sign
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    Post subject: Re: Handling Sign
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    Post subject:
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.

http://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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ON ERROR handling soundarr PL/I & Assembler 2 Wed May 11, 2016 3:37 am
No new posts Exception Handling in Native Stored P... Mariraj DB2 1 Thu Feb 25, 2016 4:08 am
No new posts IGZ0040S An invalid separate sign was... kishpra COBOL Programming 13 Sun Aug 02, 2015 2:41 am
No new posts How to modify the value using the sig... Vinay Pushpala PL/I & Assembler 3 Fri Feb 13, 2015 2:10 pm
No new posts Handling Rexx Abend trushant.w CLIST & REXX 3 Thu Jan 08, 2015 6:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us