Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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