If I have a Natural program that issues :-
CALL PROGA #DAT1 #DAT2 where PROGA is a CICS assembler program
what is in the COMMAREA pointed to by DFHEICAP (or wherever) when my assembler program gets control, please?
I don’t know about CICS, but in the environments I use (COM-PLETE and batch) Natural uses standard OS linkage conventions. For your example, register 1 would point to a two-word parameter list, with the first word containing the address of #DAT1 and the second the address of #DAT2 with the high-order bit set. I’ve never used it, but I believe register 0 points to a representation of the format/length for the passed fields.
The one thing that has bit me with Natural’s CALL statement — if you specify a group name, Natural expands it to a list of all the fields in the group. For example:
DEFINE DATA LOCAL
1 #GROUP
2 #FIELD1 (A5)
2 #FIELD2 (A5)
…
CALL 'MYPROG' #GROUP
In this case (like your example) register 1 points to a two word parameter list containing the addresses of #FIELD1 and #FIELD2, the same as if you had coded “CALL ‘MYPROG’ #FIELD1 #FIELD2”.
Thanks, Curtis,
I have “kinda sorta got the impression” that the COMMAREA is pretty much set up as you say - 2 addresses with the top bit of the second one set. I’d really like to see that info in black and white somewhere, though, just to make sure I haven’t got lucky just this once and won’t be so lucky next time. Thanks for the valuable heads-up about the fields inside a group item - that could have caused me some grief.
There is more much more too. Check the Natural Statements manual under the CALL statement, it gives all the details and examples. Also, a small correction… it is Register 2 that points to a parameter description (the format and length of each variable passed), and Register 3 points to an array description list, if you passed any arrays. See also INTERFACE4 in the manuals. If you get stuck I have some assembler programs that use this in CICS.