You might be able to use the technique of sending a program message and then receiving it. The program name is part of the &SENDER parameter information.
Scott Klement documented it in this posting:

http://iprodeveloper.com/rpg-programming/how-retrieve-programs-name-cl

If you also combined it with a RTVJOBA command and referenced the &TYPE parameter/variable (Type = 1), you could test that the job is an interactive job first.
Then issue the SNDPPGMMSG and RCVMSG commands, get the name from the &SENDER variable and use it on the JOB parameter of the SBMJOB.
The CL program would submit itself.

Then as a batch job (Type = 0), you skip the SNDPGMMSG/RCVMSG and SBMJOB section of the CLP.

Scott
________________________________


Scott Schollenberger
Vice President, Research & Development

P: 610-239-9988 x305
F: 610-239-9995
E: SSchollenberger@xxxxxxxxxxxxxxxxxx
[http://www.harriscomputer.com/images/signatures/HarrisSchools.jpg]

[http://www.harriscomputer.com/images/signatures/DivisionofHarris.gif]<http://www.harriscomputer.com/>
100-2011 Renaissance Blvd.
King of Prussia, PA
19406
www.harris-schoolsolutions.com<http://www.harris-schoolsolutions.com>

This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.