View previous topic :: View next topic
|
Author |
Message |
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
Hi,
I need to pass some date parameters which are mentioned in the PROC to the JOBSYSIN. Could you please let me know if this is possible.
Thanks in advance,
Regards,
-R |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
What is "the JOBSYSIN"?
Suggest you post the PROC and execute JCL. |
|
Back to top |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
Sorry I have the following PROC and SYSIN *,
Code: |
//UNLD0500 EXEC PGM=ADUUMAIN,
// PARM=(DB2C,'VKXPOLE1','NEW/RESTART',,'MSGLEVEL(1)')
//STEPLIB DD DSN=LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPUNCH DD DUMMY
//SYSREC DD DSN=XXX.YYY,DATA,
// DISP=(NEW,CATLG,DELETE),VOLUME=(,,,8),
//SYSCNTL DD DSN=XXX.YYY.CNTL,
// DISP=(SHR,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1))
//SYSIN DD *
SELECT COUNT(*)
FROM EMPTABLE A,
WHERE JOIN_DATE = <<date passed from the job>>
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Well, that is not a PROC. . . That is inline jcl. A PROC may not have a DD *.
To do what you want, have the earlier step (the one that passes the date) write
Code: |
WHERE JOIN_DATE = TheDate |
into a dataset (THEDATE.FILE) and concatenate this behind the first 2 bits of the SELECT statement. It will be like:
Code: |
//SYSIN DD *
SELECT COUNT(*)
FROM EMPTABLE A,
// DD DSN=THEDATE.FILE,DISP=SHR
|
|
|
Back to top |
|
|
VVRAVINDRA
New User
Joined: 04 Aug 2008 Posts: 46 Location: Chennai
|
|
|
|
Sorry, my bad....
it worked for me a lot. Thanks a many for the help...
U r Awesome.
Regards,
-R |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Ravi,
You're welcome, good to hear it worked - thanks for letting us know
Also, thanks for the kind words.
d |
|
Back to top |
|
|
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
Hi Dick,
I have a similar kind of problem. I have 59 tables all first qualifier of all the 59 tables differ. I have a JCL that has 59 steps each step executing a query present in SYSIN. Before each step, i wanted to chane the variable QUALIFIER. Is there a way of doing this??? Please suggest.
Code: |
//EXECSQL1 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBCD)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) PARMS('ALIGN(LHS)')
END
//SYSIN DD *
SELECT COUNT(*) FROM &QUALIFIER.TFAJ519 WITH UR;
/*
|
I tried to put sysin in a separate dataset as well. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
As has been discussed many times before.
Create a program that accepts the value of &QUALIFIER via a parameter. The program should then resolve that parameter to it's assigned value, and then create the required output with the properly resolved value.
The bigger issue for you is, with 59 steps, how do you intend to go about specifying the value for &QUALIFIER between all the steps, keeping the constructs and constraints of JCL processing in mind? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
One thing you could do is to create 59 members that contain:
Code: |
SELECT COUNT(*) FROM THE_ACTUAL_QUALIFIER.TFAJ519 WITH UR; |
The jcl would then reference these members rather than have a DD * for the SYSIN.
Code: |
//SYSIN DD DSN=THESYSIN.PDS(ACTUAL_QUALIFIER),DISP=SHR |
If the posted jcl was actually a cataloged procedure and the SYSTSIN info also put in a member you could use:
Code: |
//SYSTSIN DD DSN=THESYSIN.PDS(SOMENAME),disp=shr
//SYSIN DD DSN=THESYSIN.PDS(&QUAL),DISP=SHR |
Then there would be 59 executes for the proc with a different qualifier for each run.
As Kevin mentioned, you could also create these "on the fly". If you do this on the file, i'd suggest a file that contains the quailfiers be read into your pgm and generate the needed statements for the executions. |
|
Back to top |
|
|
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
Hi Dick,
Thanks a lot for your suggestion. But, I did it in the following way.
1.Create a JCL that calls a REXX
2. There will be only one control card that rexx opens and changes the qualifier inside it. Basically rexx reads all the qualifiers from a dataset and puts in an array and a loop is run n ( n = number of elements read from the dataset) numer of times. Inside the loop rexx changes the control card and submits a job which uses the changed control card everytime.
Here i am posting the REXX part inside the loop for the benifit of others.
Please let me know if this can be done in a better way.
Code: |
"ALLOC DA('G70377.REXX.FILE2') F(Mydd) SHR"
"EXECIO 1 DISKRU Mydd 2 (LIFO"
PULL LINE
PUSH ' FROM ' QUALIFIER'.PLAN_TABLE A'
"EXECIO 1 DISKW Mydd (FINIS"
"FREE F(kkkkk)"
ADDRESS TSO
"SUBMIT 'G70377.KRANTHI.JCL(JCL)'"
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear you hve a solution that works for you - thanks for sharing
The only observation i'd offer is that this way there will be 59 separate jobs to deal with. My preference would be one job, but i believe you could accomplish this via rexx as well.
If the 59 jobs works better for you, cool
d |
|
Back to top |
|
|
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
Why do we need 59 jobs for this? The same skeleton JCL is being used, except that the control card used by the JCL is changed by rexx everytime before submitting the job.
If you are talking about the number of times that the job is submitted, yes the number of submissions are 59. But is it really going to impact the performance? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It will not impact the performance on the system. It may impact your personal performance<g>. It will give 59 jobs that (i believe) will just be clutter when a single job would do.
If you want to look at 59 separate job's outputs, ok, but i'd prefer to look at the outputs of only one job. |
|
Back to top |
|
|
|