Requires Free Membership to View
Here is a partial example of what your code could look like. The function "setenv" is a C routine in the LE run-time library. You must compile with PGMNAME(LONGMIXED) to allow the lower-case routine name:
FILE-CONTROL.
* Assign CARD-OUT to Environment Variable "PRINT"
SELECT CARD-OUT ASSIGN S-PRINT STATUS IS PRINT-STAT.
01 ENV-VARS.
05 ENV-NAME PIC X(8).
05 ENV-VALUE PIC X(100).
05 ENV-OVERWRITE PIC S9(8) COMP.
01 PRINT-STAT PIC 99.
PROCEDURE DIVISION.
SETUP.
MOVE z'PRINT' TO ENV-NAME.
* Note the continued null-terminated literal
MOVE z'DSN(PR.SMSPR.UNIQUE.QUALIFIER.UNIQUEDATE),NEW,CYL,SPAC
- 'E(5,5),UNIT(SYSDA),CATALOG'
TO ENV-VALUE.
MOVE 1 TO ENV-OVERWRITE.
CALL "setenv" USING ENV-NAME, ENV-VALUE, ENV-OVERWRITE.
* Allocate dataset PR.SMSPR.UNIQUE.QUALIFIER.UNIQUEDATE
* and OPEN it for OUTPUT
OPEN OUTPUT CARD-OUT.
This was first published in March 2005
Data Center Strategies for the CIO

Join the conversationComment
Share
Comments
Results
Contribute to the conversation