
GETMAIN ACROSS LINKAGE IN COBOL
Same question, different values, you asked in another thread...but
Quote:
> [Second] Question-2
> what happens when this field is used with COBOL verbs like
> INITIALIZE , INSPECT ??
> will I get a S0C-4 ??
In the other thread, someone suggested you pass an item of USAGE POINTER to
GETMAIN. Once you have the pointer, you can SET ADDRESS OF (item in linkage
section to which you do have addressability) TO (valid pointer obtained by
GETMAIN) and use COBOL verbs on that item.
(I think).
But of course, then why bother with GETMAIN, as COBOL will allocate the
space for the COBOL dataname? Well, if you were trying to create a large
table of items, you could work on them one at a time in COBOL defining only
one element in LINKAGE, SET ADDRESS as above, then SET ADDRESS OF (this
item) UP BY FUNCTION LENGTH(this item) to "walk the table."
(Also a guess).
Probably worth a try?
I don't know squat about how this stuff might work/not work under CICS,
which I have gathered uses some of its own rules for allocations and
addressing, but this might be worth tinkering with.
(Doesn't CICS have its own callable functions for allocations?)
MCM