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: 6966
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: 6966
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 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
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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