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
 
To find the size of variable?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
karamveer hooda

New User


Joined: 03 Apr 2008
Posts: 3
Location: India

PostPosted: Mon Apr 21, 2008 1:04 pm    Post subject: To find the size of variable?
Reply with quote

HI,
Is their is any way to display out the length of variable we use through cobol program ? eg s9(11) comp-3.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 21, 2008 2:40 pm    Post subject:
Reply with quote

you can always use:
DISPLAY LENGTH OF NUM-FIELD-1

What is your reason to display the length of a variable?

It will not change, unless you make a change to the pic clause and recompile the program.

If you generally need to know the length of fields, look at the compile listing.
Back to top
View user's profile Send private message
karamveer hooda

New User


Joined: 03 Apr 2008
Posts: 3
Location: India

PostPosted: Mon Apr 21, 2008 2:45 pm    Post subject:
Reply with quote

Thanks dbz,
Actually i want to know the variable length of those group variable having sub variable of sync, comp-3 like variables.
I want to know actual byte taken by variable. for eg.
s9(4) comp takes 2 byte.
I want to display this 2 byte in my spool through display or what so ever is the syntax. Looking forward for your reply.
thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 21, 2008 3:06 pm    Post subject:
Reply with quote

I would suggest that you look at the object map generated by the compiler.

Otherwise, the display statement that I provided will function.
Back to top
View user's profile Send private message
karamveer hooda

New User


Joined: 03 Apr 2008
Posts: 3
Location: India

PostPosted: Tue Apr 22, 2008 9:49 am    Post subject:
Reply with quote

Thanks dbz..
i have implemented your suggestion
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm

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