Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
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 while Moving

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message

New User

Joined: 17 Feb 2004
Posts: 19
Location: pune

PostPosted: Fri Oct 21, 2005 12:21 pm    Post subject: Handling sign while Moving
Reply with quote

Hi all

I am getting 11 chars length String (ex.0000001010{ , +0000090191, -0000020503 ) from Java People, once i get this i have to do two things.

1. If the Input is already overpunched ( ex: 0000001010{ ), i have to convert it into signed numeric (based on the overpunch '+' or '-') , i mean to the original value

2.If the Input is not overpunched (ex: +00000010101 )i have to convert it into overpunch format, for this case if the input string has '-' (minus) as first char my pgm shud be able to identify that (for this case i can simply use the input as base as it will come with '-' sign, but is there any logic in COBOL to identify this sign....?)

ex: +00000010101 (before overpunch )
0000001010A (after overpunch)

take the last char which is '1' and check the sign which is '+' , so these two will b converted to 'A'.

its urgent plz help me out.
Back to top
View user's profile Send private message


Super Moderator

Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 22, 2005 8:57 pm    Post subject:
Reply with quote

Hi Reddy,

The { is a 0, the A is a 1, the B is a 2, etc., so I'm assuming that you mean 0000001010{ is already the way you want it and only the +/- numbers have to be converted to opunch.

If this is not correct, please provide an example of what 0000001010{ should be converted to; if what I assumed IS correct, you can try something like this:

01  your-orig-fld        pic  x(11).
01  hold-fld.
    05  hld-opch-fld     pic S9(11).
    05  hld-sinl-fld     redefines
        hld-opch-fld     pic S9(10) sign leading separate.

01  recv-fld             pic s9(11).

move your-orig-fld   to hold-fld
if hold-fld(1:1)    not numeric
   move hld-sinl-fld to recv-fld
   move hld-opch-fld to recv-fld

If " not numeric" doesn't work try " = ('+' or '-')".
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am
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 MOVING COMP-3 into binary akodakka COBOL Programming 2 Tue Dec 01, 2015 5:02 pm

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