× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 13-Nov-2013 11:16 -0800, Steinmetz, Paul wrote:
Is there a way to have a submitted job "job name" to default to the
program name?
Currently, from the help text, I only see two options.
The default is *JOBD, which is almost useless.

*JOBD
The simple name of the job description used with this job is the
name of the job itself.

name
Specify the simple name of the job that is used while it is being
processed by the system.


The SBMJOB command starts a /request/ [i.e. RQSDTA()] or a /command/ [i.e. CMD()]. The Submit Job (SBMJOB) command does not start a /program/ by name; the request or command would be a command string in the form of 'CALL PGM(pgm_name) PARM(...)'. If submitting the request to invoke the program is being made from a CLP, for example, the effect is easy enough by coding the program name to come from a variable, and using that variable on both the submitting and the submitted commands:
SBMJOB CMD(CALL PGM(&PGM_NAME)) JOB(&PGM_NAME)

Otherwise a custom version of the SBMJOB command [e.g. named SBMPGM] that would invoke a CPP that is designed to parse the CMD string [and if a RQSDTA is also allowed, then that instead, if required]. That command could omit any support for a JOB() parameter, or just add a new special value of *CALLEDPGM [optionally as the default]. That CPP would then issue the request as:
QSYS/SBMJOB CMD(&THE_CMD) JOB(&PARSED_PGM) ...

However the above technique has long been possible to be replaced by an API to avoid or reduce the complexity. There are probably some decent enough examples that can be found that use the Replace Command Exit Program (QCARPLCM) API, such that in conjunction with parsing of the /command string/ to obtain the PGM() specification of the CALL command, the JOB() parameter specification of the SBMJOB request could be added or updated to reflect the named /program/ (PGM) from the CALL coded in the request data (RQSDTA) or the command (CMD) parameter.

http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/apis/qcarplcm.htm
_i Replace Command Exit Program (QCARPLCM) API i_
"...
The Replace Command Exit Program (QCARPLCM) API may be used as the exit program for the QIBM_QCA_CHG_COMMAND for any command. If the original command was library-qualified with *SYSTEM or *NLVLIBL, the library qualifier will be replaced with *LIBL. None of the parameter values specified on the original command will be changed. ...
..."


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.