|
CEE3PRM
queries and returns to the calling routine the parameter string specified
at invocation of the program. The returned parameter string contains
only program arguments. If no program arguments are available, a blank
string is returned.
Syntax
>>-CEE3PRM--(--char_parm_string--,--fc--)----------------------><
- char_parm_string (output)
- An 80-byte fixed-length
string passed by CEE3PRM. On return from this service, the char_parm_string contains
the parameter string specified at invocation of the program. If this
parameter string is longer than 80 characters, it is truncated. If
the parameter string is shorter than 80 characters, the returned string
is padded with blanks. If the program argument passed to the service
is absent, or is not a character string, char_parm_string is
blank.
- fc (output)
- A 12-byte feedback code, optional in some languages,
that indicates the result of this service. If you choose to omit this
parameter, refer to Invoking callable services for the
appropriate syntax to indicate that the feedback code was omitted.
The
following symbolic conditions can result from this service:
Code |
Severity |
Message number |
Message text |
---|
CEE000 |
0 |
— |
The service completed successfully. |
CEE3I1 |
1 |
3649 |
The parameter string returned from CEE3PRM exceeded the maximum
length of 80 bytes and was truncated. |
Usage notes - C/C++ consideration—C/C++ users
can use the __osplist to return a program argument
longer than 80 characters.
- z/OS UNIX considerations—CEE3PRM
is allowed only in the initial thread.
- You can use the CEE3PR2 callable service to return a program string
that is longer than 80 characters.
Examples - Following is an example of CEE3PRM called by C/C++.
/*Module/File Name: EDC3PRM */
#include <stdio.h>
#include <leawi.h>
#include <stdlib.h>
#include <string.h>
#include <ceeedcct.h>
int main() {
_CHAR80 parm;
_FEEDBACK fc;
CEE3PRM(parm,&fc);
if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
printf("CEE3PRM failed with message number %d\n",
fc.tok_msgno);
exit(2999);
}
printf("%.80s\n",parm);
}
- Following is an example of CEE3PRM called by COBOL.
CBL LIB,QUOTE
*Module/File Name: IGZT3PRM
************************************************
** **
** CBL3PRM - Call CEE3PRM to query the **
** parameter string **
** **
** In this example, a call is made to **
** CEE3PRM to return the parameter string **
** that was specified at invocation of the **
** program. The string is then displayed. **
** **
************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBL3PRM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PARMSTR PIC X(80).
01 FC.
02 Condition-Token-Value.
COPY CEEIGZCT.
03 Case-1-Condition-ID.
04 Severity PIC S9(4) BINARY.
04 Msg-No PIC S9(4) BINARY.
03 Case-2-Condition-ID
REDEFINES Case-1-Condition-ID.
04 Class-Code PIC S9(4) BINARY.
04 Cause-Code PIC S9(4) BINARY.
03 Case-Sev-Ctl PIC X.
03 Facility-ID PIC XXX.
02 I-S-Info PIC S9(9) BINARY.
PROCEDURE DIVISION.
PARA-CBL3PRM.
CALL "CEE3PRM" USING PARMSTR, FC.
IF CEE000 THEN
DISPLAY "Program arguments specified: "
"'" PARMSTR "'"
ELSE
DISPLAY "CEE3PRM failed with msg "
Msg-No of FC UPON CONSOLE
STOP RUN
END-IF.
GOBACK.
- Following is an example of CEE3PRM called by PL/I.
*PROCESS MACRO;
/* Module/File Name: IBM3PRM */
/****************************************************/
/** **/
/** Function: CEE3PRM - Query Parameter String **/
/** **/
/****************************************************/
PLI3PRM: PROC OPTIONS(MAIN);
%INCLUDE CEEIBMAW;
%INCLUDE CEEIBMCT;
DCL PARMSTR CHAR(80);
DCL 01 FC, /* Feedback token */
03 MsgSev REAL FIXED BINARY(15,0),
03 MsgNo REAL FIXED BINARY(15,0),
03 Flags,
05 Case BIT(2),
05 Severity BIT(3),
05 Control BIT(3),
03 FacID CHAR(3), /* Facility ID */
03 ISI /* Instance-Specific Information */
REAL FIXED BINARY(31,0);
/* Call CEE3PRM to return the program arguments */
/* specified at invocation of the program */
CALL CEE3PRM ( PARMSTR, FC );
/* There are no non-zero feedback codes to */
/* check, so print result */
IF FBCHECK( FC, CEE000) THEN DO;
PUT SKIP LIST(
'These program arguments were specified: "'
|| PARMSTR || '"');
END;
ELSE DO;
DISPLAY( 'CEE3PRM failed with msg '
|| FC.MsgNo );
STOP;
END;
END PLI3PRM;
|