On 10/2/2013 10:36 AM, Raupach, Robert E (CTO Architecture + Engineering) wrote:
Greetings...

A colleague asked me the following question:

   "Is there a way to determine how many parameters are being passed into a COBOL 
program?"

I could show him in Assembler, but in COBOL, I wouldn't have a clue.

Can someone advise?
Thx,
Bob R

I doubt you could show him in Assembler, in the general case.

Since parameters can now be passed by reference (the classic style),
by content (like the classic style but passing the address of a
copy of the data instead of the address of the actual data), and
by value (value embedded in the parameter list); and since not all
languages honor the end of list flag (leftmost bit on in the last
entry in the parameter list), I don't think there is a generic way
to find out the answer you are asking.

However, the subroutine is the source for what is allowed / expected,
so if it is properly invoked, and if there is a chance of multiple
arguments being recieved, there must be some convention established
for determining this (e.g., one argument might be expected to contain
the count of the number of arguments coming in).

In our 3 day course "Cross Program Communication in z/OS" we include
some discussion on how to pass and receive a varying number of
parameters / arguments in Assembler, COBOL, PL/I, and C. See:

  http://www.trainersfriend.com/Language_Environment_courses/m520descr.htm

--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-355-2752
http://www.trainersfriend.com

* We are going out of business effective 30 December, 2013

* To purchase a set of our training materials at terrific prices,
  check out our Going Out Of Business Sale:

    http://www.trainersfriend.com/SpecialSale

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to