Hello everyone,
Could you please teach me if there is a solution that I can retrieve current jcl job's DSN name and show it in log?
For example the current jcl job's DSN name is "USER.MEMBER.PDS(LIST05)", I want add some code(use some system function(like &SYSUID,&SYSDATE...) or some automatic method instead of manually input) in this jcl to show the DSN(current job) in the log after the job was executed.
Thanks!
Geo
/* REXX edit macro to prevent the submission of some jobs */
/*** trace ?r ***************************************************** \| *
* (C) Copyright Robert AH Prins, 2010-2010 *
************************************************************************
* ------------------------------------------------------------------ *
* | Date | By | Remarks | *
* |------------+------+----------------------------------------------| *
* | | | | *
* |------------+------+----------------------------------------------| *
* | 2010-05-07 | RAHP | Check for > 5 jobs on output queue | *
* |------------+------+----------------------------------------------| *
* | 2010-03-29 | RAHP | Initial version | *
* |------------+------+----------------------------------------------| *
************************************************************************
* LOGSUB is a REXX edit macro to prevent the submission of jobs that *
* do not follow certain rules: *
* *
* 1) The JOBNAME must start with the userid of the submitter *
* 2) It is not allowed to use any PRTY= keywords *
************************************************************************
* Send questions, suggestions and/or bug reports to: *
* *
* robert(a)prino(d)org / robert(d)a(d)h(d)prins(a)gmail(d)com *
* *
* Robert AH Prins *
* Ožkinių gatvė 48 *
* Vilnius 08410 *
* Lithuania *
************************************************************************
* More z/OS tools @ <https://prino.neocities.org/zOS/zOS%20Tools.html> *
************************************************************************
* This program is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
***********************************************************************/
parse source source
parse value source with . . moi .
"isredit macro (parm) PROCESS"
"ispexec control errors return"
user = userid()
if user = someone_special |,
user = maybe_me |,
user = the_boss |,
user = another_exception? then
do
"isredit builtin submit"
exit
end
"isredit (STATE) = user_state"
"isredit (DSN) = dataset"
"isredit (MEM) = member"
id = '//* Submit ID: 'dsn'('mem')'
zedsmsg = ''
zedlmsg = ''
"isredit (L) = line 1"
parse value l with '//' jobname ' ' .
/***********************************************************************
* Check that the JOBNAME starts with the USERID *
***********************************************************************/
if abbrev(jobname, user) = 0 then
zedlmsg = 'SUBMIT cancelled, JOBNAME must start with' user
else
do
/*******************************************************************
* Do not allow users to jump the queue *
*******************************************************************/
"isredit f 'PRTY=' first"
if rc \= 0 then
"isredit f '/*PRIORITY' first"
if rc = 0 then
zedlmsg = 'SUBMIT cancelled, jumping the queue is NOT allowed'
end
trap = outtrap('st.')
/***********************************************************************
* Will always capture at least one line, the TSO session *
***********************************************************************/
"st" user
/***********************************************************************
* Will always capture at least one line, either a job with this name, *
* or the 'JOB xxxxxxxx NOT FOUND' message *
***********************************************************************/
if length(jobname) - length(user) > 1 then
"st" jobname
trap = outtrap('OFF')
/***********************************************************************
* This allows them to have no more than 4 jobs on the output queue *
***********************************************************************/
if st.0 > 6 then
do
zedlmsg = 'SUBMIT cancelled, too many jobs on the output queue.',
'Please remove them before resubmitting this job.'
end
if zedlmsg = '' then
do
"isredit f ' EXEC ' first"
if rc = 0 then
"isredit line_before .zcsr = (ID)"
"isredit builtin submit"
"isredit f ' Submit ID:' first"
if rc = 0 then
"isredit del .zcsr .zcsr nx all"
end
else
do
"ispexec setmsg msg(ISRZ001)"
if st.0 > 5 then
do
zcmd = ";sdsf;pre" user"*;owner" user"*;st"
"ispexec control nondispl end"
"ispexec display panel(isr@prim)"
end
end
"isredit user_state = (STATE)"
exit