Bob,
hereby a piece of code where I call AMATERSE to UNTERSE ... it's not
important anyway I think it's what you're looking for.
It allocs the needed DDNAMEs and then call AMATERSE and after reads
SYSPRINT (output from AMATERSE) to evaluate the run.
What you're interested in is the LINKMVS and it's important that the PARM
must be a variable you've just initialized before.
Hope this helps.
Regards.
Max
/*-------------------------------------------------------------------*/
ESEGUI_UNTERSE:
RC_UNTERSE = 0
ADDRESS TSO "FREE FI(SYSUT1)"
ADDRESS TSO "FREE FI(SYSUT2)"
ADDRESS TSO "FREE FI(SYSPRINT)"
FN = ARG(1)
PREF = ARG(2)
DTJ = DATE("J")
DTJ = DTJ
TIMEX = TIME()
PARSE VAR TIMEX HH":"MM":"SS .
TIMEL = HH !! MM !! SS
DSN_TEMP = PREF".SQBN0G."JOBNAME"."JOBID".D"DTJ".T"TIMEL
IF LENGTH(DSN_TEMP) > 44 THEN DO
SAY "ERRORE IN DETERMINAZIONE DSN_TEMP - LUNGHEZZA > 44:"DSN_TEMP
MAX_RC = 99
CALL FINE
END
MSG_TEMP = PREF".SQBN0G."JOBNAME"."JOBID".D"DTJ".M"TIMEL
ADDRESS TSO "ALLOC FI(SYSUT1) DA('"FN"') SHR"
RCL = RC
IF RCL <> 0 THEN DO
SAY "ERRORE IN ALLOCAZIONE FILE DI INPUT UNTERSE:"RCL
MAX_RC = 99
CALL FINE
END
ADDRESS TSO "FREE ATTRLIST(AT)"
ADDRESS TSO "ATTR AT DSORG(PS)"
ADDRESS TSO "FREE F(SYSUT2)"
/* DI SOLITO COMPRESSIONE = 10/1 */
PQTY = SYSPRIMARY * 10
SQTY = SYSSECONDS * 10
SELECT
WHEN SYSUNITS = "TRACK" THEN TQTY = "TRACKS"
WHEN SYSUNITS = "CYLINDER" THEN TQTY = "CYLINDERS"
OTHERWISE DO
SAY "TROVATA UNITA' DI ALLOCAZIONE NON PREVISTA:"SYSUNITS
MAX_RC = 99
CALL FINE
END
END
"ALLOC F(SYSUT2) UNIT(SYSDA) SPACE("PQTY SQTY")",
TQTY "DATACLAS(UEFSQCMP) NEW CATALOG",
"DA('"DSN_TEMP"') USING(AT)"
RCL = RC
IF RCL <> 0 THEN DO
SAY "ERRORE IN ALLOCAZIONE FILE TEMPORANEO UNTERSE:"RCL
MAX_RC = 99
CALL FINE
END
ADDRESS TSO "FREE ATTRLIST(AT)"
ADDRESS TSO "ATTR AT LRECL(132) RECFM(F B A) DSORG(PS)"
"ALLOC F(SYSPRINT) UNIT(SYSDA) SPACE("10 10")",
"TRACKS NEW CATALOG",
"DA('"MSG_TEMP"') USING(AT)"
RCL = RC
IF RCL <> 0 THEN DO
SAY "ERRORE IN ALLOCAZIONE FILE MESSAGGI UNTERSE:"RCL
MAX_RC = 99
CALL FINE
END
ADDRESS TSO "FREE ATTRLIST(AT)"
ACTION = "UNPACK"
ADDRESS LINKMVS "AMATERSE ACTION"
RCL = RC
IF RCL <> 0 THEN DO
IF RCL > 8 THEN DO
SAY "ERRORE IN AMATERSE NON PREVISTO:"RCL
ADDRESS MVS "EXECIO * DISKR SYSPRINT(FINIS STEM UNTERSE.)"
CALL STAMPA_MSG_UNTERSE
MAX_RC = 99
CALL FINE
END
SAY "ERRORE IN CALL AMATERSE:"RCL
RC_UNTERSE = 4
END
ADDRESS TSO "FREE FI(SYSUT1)"
ADDRESS TSO "FREE FI(SYSUT2)"
ADDRESS MVS "EXECIO * DISKR SYSPRINT(FINIS STEM UNTERSE.)"
ADDRESS TSO "FREE FI(SYSPRINT)"
RETURN RC_UNTERSE
Il giorno ven 30 apr 2021 alle ore 20:34 Bob Bridges <[email protected]>
ha scritto:
> I know I've done this before, but I'm having trouble doing something that
> most of you will say should be simple. I have some JCL that executes a
> program in batch, and I want to create a REXX that does it in the
> foreground - allocates the datasets, runs the program, then fetches the
> output and displays it in View. The program requires something in the
> PARM, and I'm having trouble remembering the syntax for that. Here's what
> I've tried:
>
>
> +-----------------------------------+------------------------------------------------------------+
> + call '<program>,<parm>' | Error running <exec>, line <nn>:
> Routine not found |
>
> +-----------------------------------+------------------------------------------------------------+
> + address LINK '<program>,<parm>' | RC -3 (routine not found)
> |
>
> +-----------------------------------+------------------------------------------------------------+
> + '<program>','<parm>' | Error running <exec>, line <nn>:
> Unexpected "," or ")" |
> + address LINK '<program>','<parm>' |
> |
>
> +-----------------------------------+------------------------------------------------------------+
> + call '<program> <parm>' | Error running <exec>, line <nn>:
> Incorrect call to routine |
> + call '<program>' '<parm>' |
> |
> + call '<program>','<parm>' |
> |
>
> +-----------------------------------+------------------------------------------------------------+
> + '<program> <parm>' | Program returns RC and complains
> it can't see the PARM. |
> + '<program>,<parm>' |
> |
> + '<program>' '<parm>' |
> |
> + address LINK '<program> <parm>' |
> |
> + address LINK '<program>' '<parm>' |
> |
>
> +-----------------------------------+------------------------------------------------------------+
>
> Unless I go to LINKMVS or LINKPGM (and I don't know what those are for), I
> think I've used up all the possible combinations. What am I missing?
>
> ---
> Bob Bridges, [email protected], cell 336 382-7313
>
> /* You do not examine legislation in the light of the benefits it will
> convey if properly administered, but in the light of the wrongs it would do
> and the harms it would cause if improperly administered. -Lyndon Johnson */
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN