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

Declaring variable such leading zero should be supressed


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Sat May 26, 2007 12:32 pm
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
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

Moderator Emeritus


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

PostPosted: Sat May 26, 2007 2:31 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top