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
 

 

Declaring variable such leading zero should be supressed

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

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Sat May 26, 2007 10:17 am    Post subject: Declaring variable such leading zero should be supressed
Reply with quote

Hi ,

I want to declare a varible in working storage such that leading zero should be supressed and those space are not left it as blank..


ie I declared a variale 'AUTH-CODE'
If I am moving a value '00045' then the edited result should be '45' not 'bbb45'. And give the memory utlization details such a varible
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 26, 2007 12:32 pm    Post subject:
Reply with quote

Hello,

If you search in this COBOL forum, you will find an answer to this. If i recall correctly, there are multiple ways posted.

Here is one of them:
http://ibmmainframes.com/viewtopic.php?t=13592
Back to top
View user's profile Send private message
prabe

New User


Joined: 09 Mar 2007
Posts: 17
Location: kerala

PostPosted: Sat May 26, 2007 2:18 pm    Post subject: Re: Declaring variable such leading zero should be supressed
Reply with quote

sorry, I want to know can we declare a variable such that it size will adjust according to size of input given to it ..


ie move 1256 to ws-auth ( then ws-auth size should be 9(4))

move 124 to ws-auth ( then ws-auth size should be 9(3))
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 26, 2007 2:31 pm    Post subject:
Reply with quote

Hello,

No language i know of changes field definitions on the fly.

You need to define them and then use that definition.

The link posted will do what you say you want and there are other solutions posted if you take the time lo look for them.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


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