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

Prefixing Zeroes to Alphanumeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Wed Oct 27, 2010 9:58 pm
Reply with quote

Hi All,

I will be entering the amount values in the screen and need to edit the entered amount.

Initially all the fields in the CICS screen will be '____' [PIC X(4)]. So the user can enter the amount as 10 or 11 or 123, 1234 etc.. Then I will do numeric check in the COBOL prgoram. If the entered amount is 12, it will be coming to the program as 12__
Is there any way, I can edit the program and make it as 0012 ?

Similarly, the entered value '10' in screen will be 10__ but need to change it as 0010 in the program.
Similarly the value '1' can be entered as ___1 and we need to make it as 0001 (I think this case can be checked using INSPECT variable REPLACING ALL '_' BY ZEROES after checking for leading '-').

Please help me.

Thanks
Vinu
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 27, 2010 10:32 pm
Reply with quote

Why not use EXEC CICS BIF DEEDIT?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 27, 2010 10:41 pm
Reply with quote

why Pic x(4) and not Pic 9(4)?????
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Wed Oct 27, 2010 10:56 pm
Reply with quote

Thanks Robert for the suggestion. It worked.

@ Dbz - I have used X(4) since it is defined as X(4) in map variable.

Thanks
Vinu
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 27, 2010 11:15 pm
Reply with quote

Glad to hear it works! icon_biggrin.gif
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Remove leading zeroes SYNCSORT 4
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
No new posts Packed decimal to Alphanumeric COBOL Programming 2
No new posts How to fill with zeroes pd intended s... DFSORT/ICETOOL 6
No new posts Converting spaces to zeroes DFSORT/ICETOOL 7
Search our Forums:

Back to Top