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
 

 

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 Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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