View previous topic :: View next topic
|
Author |
Message |
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
I've seen similar questions in the forum but none exactly addresses the situation I face. I hope someone can help.
I have a job that sends a file to a printer. Before this job executes, another job creates the input for this job and the number of files varies from run to run. I can do a LISTCAT to get all the filenames that were created. I can only send one file at a time to the printer because of size constraints. I want to dynamically pass the created dataset names one by one to the send job and execute the job for each file that is passed to it. I have permission to change the send job. Any ideas? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You could read the dataset containing the filenames creating jcl "on the fly" for each "send". You could create one job with multiple steps or multiple jobs that process one file each.
The jcl you dynamically create, would be "written" to the internal reader.
If i've not understood your request, please clarify. |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
Hi Dick
Thanks for the reply. I suppose in your reply you're referring to accomplish this through COBOL? Am I right? I am including the guts of a program I wrote. The reason I am doubting this program is because I cannot get the JCL that's submitted from the program to abend. I need to see what the output will be if this job should abend. Any comments is appreciated.
Code: |
PERFORM VARYING WS-FNAMES-CNT FROM 1 BY 1 UNTIL
WS-FNAMES-CNT > WS-NOF-FNAMES
OPEN OUTPUT JOB-OUT
IF WS-FILE-STATUS NOT = "00"
DISPLAY "JOB-OUT OPEN ERROR ; STATUS = "
WS-FILE-STATUS
PERFORM ZPJFW-ABORT-HALT
END-IF
* Send JCL to output
PERFORM VARYING WS-NOF-CARDS FROM 1 BY 1 UNTIL
WS-NOF-CARDS > WS-CARDS-CNT
* Change "DSN=" in JCL
IF DD-NAME (WS-NOF-CARDS) = "SYSUT1"
MOVE WS-FILENAME (WS-FNAMES-CNT)
TO DSN-NAME (WS-NOF-CARDS)
END-IF
MOVE WS-JOB-CARD (WS-NOF-CARDS)
TO JOB-OUT-REC
* To force a JCL error.
MOVE ALL "X" TO JOB-OUT-REC
WRITE JOB-OUT-REC
END-PERFORM
* Submit job automatically to JES via Internal Reader
CLOSE JOB-OUT
IF WS-FILE-STATUS NOT = "00"
DISPLAY "JOB-OUT CLOSE ERROR ; STATUS = "
WS-FILE-STATUS
PERFORM ZPJFW-ABORT-HALT
END-IF
END-PERFORM. |
My jcl follows :
Code: |
//STEPRUN EXEC PGM=SPLITFIL,COND=(0,GT)
//*
//STEPLIB DD DSN=MY.STEP.LIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//IDCAMS DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//*
//JOBIN DD DSN=MY.JCL.PDS(SENDJOB),DISP=SHR
//FNAMES DD DSN=MY.INPUT.FILENAMES.SEQ,
// DISP=SHR
//JOBOUT DD SYSOUT=(A,INTRDR)
//*---------------------------------------------------------------------
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
COBOL works well. You could use other tools also. . .
Quote: |
The reason I am doubting this program is because I cannot get the JCL that's submitted from the program to abend |
I'm not clear on why the submitted jcl needs to abend
One way to see the output of an abend is to compile a "special" version of the program that will be run within the submitted jcl, and cause an 0c7.
It appears thet the JOB statement will be written too many times. The XXXXX's statement could cause a jcl error, but should not cause an abend.
If you post the output of the program (rather than sending it thru the internal reader), that may help as well.. |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
Me again Dick
I've taken note of the points you've raised. Regarding the job statement, do you suggest submitting only the step from the second submission onwards? Can you submit a step on it's own to the Internal Reader? Ive decided to take the COBOL route to solve this situation. Thank you very much for your input 'till now. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
You can submit only JOBS to the internal reader not individual steps. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello again
Quote: |
Regarding the job statement, do you suggest submitting only the step from the second submission onwards? |
I suggest submitting one job with "all of the steps" or several jobs with one step each - whichever better suits your requirement.
Ooops, I was reading the code incorrectly Too quickly, i read WS-JOB-CARD as the JOB statement
Is your question about an abend resolved?
Quote: |
Can you submit a step on it's own to the Internal Reader? |
No, when you submit, a JOB needs to be submitted. |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
Thanks guys
My question about the abend is not really solved. I tried to abend the job so I could see where the output of the abend would be and what it will look like. |
|
Back to top |
|
|
bijumon
New User
Joined: 14 Aug 2006 Posts: 20 Location: Pune,India
|
|
|
|
Hi donevin,
you can also try using an array, to build the JOB, i.e. the entire job, and then (instead of using write), you can use a Perform Until, and just display wahtever is in the array, this was you can build the entire JCL and then finally do a submit to the INTRDR. As the sysout is mapped to the INDRDR in the JCL the next job would be submitted.
Please get back if iam not clear.
Thanks,
---------
Biju. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
My question about the abend is not really solved. I tried to abend the job so I could see where the output of the abend would be and what it will look like. |
You could make a version of the program that will intentionally cause a s0c7. You would then see what happens to with the output. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
donevin wrote: |
I want to dynamically pass the created dataset names one by one to the send job and execute the job for each file that is passed to it. I have permission to change the send job. Any ideas? |
Following this topic I got lost......... If the quotet is all wouldnt a symbolic parameter do? This parameter might be generated by a job to submit the receiving job via the internal reader......... Or do I completely miss the point ( i.s S0C7???????????) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi George,
Quote: |
Or do I completely miss the point |
I believe you "have" the point. As the job(s) are submitted thru the internal reader, i believe generating the value for a symbolic parameter should work pretty much the same as generating the dsn in the dd.
Much of the topic concerned seeing what happens if the submitted job abends, so we sort of got away from the main question. |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
For some reason I don't get alerts on topics that I watch anymore. Anyway, I've actually tested and handed this solution over to the person who needed help. The JCL that had to be changed on the fly is quite small and so this job is running quite fine. I had to reduce the jobs to one since I was testing on Mainframe Express and am only allowed to submit one job to the INTRDR per run. I want to ask a question Biju, if you don't mind? How exactly would the submit to the INTRDR take place as indicated by you in your response? Thanks again guys for all your input. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
Back to top |
|
|
|