IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

way to pass symbolic parameters from PROC to JOBSYSIN


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Wed Oct 14, 2009 8:52 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Oct 14, 2009 8:55 pm
Reply with quote

Hello,

What is "the JOBSYSIN"?

Suggest you post the PROC and execute JCL.
Back to top
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Wed Oct 14, 2009 9:23 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Oct 14, 2009 9:49 pm
Reply with quote

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
View user's profile Send private message
VVRAVINDRA

New User


Joined: 04 Aug 2008
Posts: 46
Location: Chennai

PostPosted: Wed Oct 14, 2009 10:08 pm
Reply with quote

Sorry, my bad....
it worked for me a lot. Thanks a many for the help...
U r Awesome.

Regards,
-R
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Oct 14, 2009 10:20 pm
Reply with quote

Hi Ravi,

You're welcome, good to hear it worked - thanks for letting us know icon_smile.gif

Also, thanks for the kind words.

d
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Nov 12, 2009 5:19 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Nov 12, 2009 5:25 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Nov 13, 2009 1:09 am
Reply with quote

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
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Nov 13, 2009 8:27 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Nov 13, 2009 9:32 am
Reply with quote

Good to hear you hve a solution that works for you - thanks for sharing icon_smile.gif

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 icon_cool.gif

d
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Nov 13, 2009 9:38 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Nov 13, 2009 10:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top