View previous topic :: View next topic
|
Author |
Message |
karamveer hooda
New User
Joined: 03 Apr 2008 Posts: 3 Location: India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
karamveer hooda
New User
Joined: 03 Apr 2008 Posts: 3 Location: India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
karamveer hooda
New User
Joined: 03 Apr 2008 Posts: 3 Location: India
|
|
|
|
Thanks dbz..
i have implemented your suggestion |
|
Back to top |
|
|
|