TechTalk: Giving CL Progarms Option to be Sent to

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

Program, JOBQ Thyself

If you have ever been frustrated with the need to write two programs in order to JOBQ a program (one to perform the task, another to do a SBMJOB), take heart. The program in 1a submits itself to the JOBQ or runs interactively, depending on the response by the operator.

If you have ever been frustrated with the need to write two programs in order to JOBQ a program (one to perform the task, another to do a SBMJOB), take heart. The program in Figure 1a submits itself to the JOBQ or runs interactively, depending on the response by the operator.

The display file declared in PROG01CL is shown in 1b. When the job is called initially, it is running interactively. If the operator types a Y option to the question, then the program submits this same job to the JOBQ and returns. Now the job is running in BATCH and the TYPE attribute is 0. When tested, the program "knows" it is running in batch and does not present the prompt screen to the operator. Instead, it branches over this and calls program PROG01.

The display file declared in PROG01CL is shown in Figure 1b. When the job is called initially, it is running interactively. If the operator types a Y option to the question, then the program submits this same job to the JOBQ and returns. Now the job is running in BATCH and the TYPE attribute is 0. When tested, the program "knows" it is running in batch and does not present the prompt screen to the operator. Instead, it branches over this and calls program PROG01.

Ted May Jefferson City, Missouri


TechTalk: Giving CL Progarms Option to be Sent to

Figure 1A CL program PROG01CL to JOBQ itself

 Figure 1a: CL Program to JOBQ Itself PROG01CL: PGM DCL VAR(&DSP) TYPE(*CHAR) LEN(10) DCL VAR(&JOBQ) TYPE(*CHAR) LEN(1) DCLF FILE(PROMPT) /* Retrieve job type. If '0', it is running in BATCH */ RTVJOBA TYPE(&JOBQ) IF COND(&JOBQ *EQ '0') THEN(GOTO CMDLBL(CALL)) /* If not, find out if the user wants to JOBQ it */ SNDRCVF IF COND(&ANSWER *EQ 'N') THEN(GOTO CMDLBL(CALL)) SBMJOB CMD(CALL PGM(PROG01CL)) JOB(PROG01) + JOBPTY(5) OUTPTY(5) LOGCLPGM(*NO) RETURN CALL: OVRDBF FILE(FILEA) TOFILE(PAYROLL) CALL PGM(PROG01) ENDPGM 
TechTalk: Giving CL Progarms Option to be Sent to

Figure 1B Display file used by program PROG01CL

 Figure 1b: Display File Used by Program PROG01CL A DSPSIZ(24 80 *DS3) A R JOBQ A BLINK A 6 12'Do you wish to submit this job to - A the JobQ?' A 13 12'Y=Yes, N=No:' A 16 12'Press Enter to continue' A ANSWER 1 B 13 36VALUES('Y' 'N') 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: