TechTalk: CALL CL Program From S/36E

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

From: David Flicek To: All

I need to submit a CL program to a job queue from a S/36E procedure. With it, I also need to pass the parameters, which are variable (not fixed). How do I do this?

From: Ernie Malaga To: David Flicek

You can build the CALL command string within a procedure parameter and then execute the parameter as follows:

 // EVALUATE + P64='CALL XYZ (?1? ?2?)' // SBMJOB CMD(?64?) JOBQ(QBATCH) 

Suppose now that parameter 1 contains 'ABC' and parameter two contains 'IJK'. The EVALUATE statement changes parameter 64 to 'CALL XYZ (ABC IJK)', and the next statement runs the program.

You'll run into a bit of trouble if the parameters need to be surrounded by single quotes. For example, if parameter 1 contains 'ABC DEF', the above technique will fail when the second statement tries to CALL program XYZ, passing it three parameters instead of two (ABC, DEF and IJK). A more generic solution, then, would be as follows:

 // EVALUATE + P64='CALL XYZ (''?1?'' ''?2?'')' // SBMJOB CMD(?64?) JOBQ(QBATCH) 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$