Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us