How do I call a QUICK slave screen from COBOL and pass parameters?

Bruce Hobbs brucehobbs@engineeredsw.com
Mon, 1 Mar 1999 01:13:43 -0500


At 2:28 PM +1100 03/01/1999, Fernando Olmos wrote:

>The problem I am getting at the moment is on how to use CALL INTRINSIC "COMMAND" USING W16-COMMAND GIVING W18-STUNO-RESULT, where W18-STUNO-RESULT is
>
> 01  W18-STUNO-RESULT            PIC S9(9) BINARY.
>
It's a little difficult to know exactly where to begin to attempt to help since there are really several problems here.

First, the COMMAND intrinsic expects three parameters and it does not return a value. Judging by the portion of your data division that you've included I'd guess your call should look more like

    CALL INTRINSIC COMMAND
      USING W16-COMMAND
            W16-ERR
            W16-PARM

Regardless of whether you're using it to do RUN, SETVAR or SHOWVAR, you should always verify that its cmderror parameter (your W16-ERR) contains the value you expect (usually zero).

Second, I don't have access to any COGNOS manuals, but I thought there was now a way for you to pass something like your student number to QUICK through the INFO parameter on the RUN statement you showed in your original post. If not, then the SETVAR approach means you'll need to invoke the COMMAND intrinsic multiple times.

Third, presuming that you have QUICK set a variable to the record count for the student I think you will probably want to use HPCIGETVAR rather than SHOWVAR to obtain the value for your COBOL program.

>BTW..... what if you want to return a character item?
>
Again, the COMMAND intrinsic doesn't itself return anything.

As Arthur indicated, it's not immediately obvious that there's much if anything to be gained by your approach compared to his suggestion, nor is it necessarily any "smarter."
=======================================================================
Bruce Hobbs, CCP, CDP   856 N Monterey St         Phone: (626) 570-8028
Partner                 Alhambra, CA 91801-1574   FAX:   (626) 570-9850
Engineered Software     E-mail: brucehobbs@engineeredsw.com
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.