View previous topic :: View next topic
|
Author |
Message |
Abhinav Chandra
New User
Joined: 13 Oct 2012 Posts: 29 Location: India
|
|
|
|
HI,
I need to compare a record present in the file with the JCL variable though JCL. Can anyone suggest me suitable approach to do so through JCL.
Cheers !! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm not sure I understand this requirement. Could you provide some more details and/or examples, and also maybe some idea of what program(s) you might be using or might want to use to accomplish this? |
|
Back to top |
|
|
Abhinav Chandra
New User
Joined: 13 Oct 2012 Posts: 29 Location: India
|
|
|
|
I need to compare the data present in PS file with the data present in the JCL variable.
Suppose the data in the PS file is 1234 and we have also declared a JCL variable as
// SET VAR1=1212.
Thus now I need to compare the data present in PS file and in JCL variable(VAR1) through JCL i.e. comparing 1234 with 1212.
Did you get it now !! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As superk mentioned, your request is rather unclear.
When you mention JCL 3 times, i suspect you mean you want to create some JCL that will execute "something" (not JCL - for example the sort) that will read a file and create/modify some JCL.
Please post what you "have" and what you want to do with it. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Ok, so you're going to pass the variable VAR1 to a program so it can be resolved by the Internal Reader during the input phase, i.e.:
//STEPX EXEC PGM=somepgm,PARM='&VAR1'
so in the jobstep STEPX you'll have the program "somepgm" receiving a value of '1212' as per your example. Then what? |
|
Back to top |
|
|
Abhinav Chandra
New User
Joined: 13 Oct 2012 Posts: 29 Location: India
|
|
|
|
HI Dick / Superk,
Yes you are correct, I need to create jcl for this.
I am having -
1. A ps file having one record = 1234
2. JCL variable referred in the same JCL itself by =
// SET VAR1=1212
I need a approach by only using JCL to compare the data present in these two (that is data in file and in variable).
Proposed work around -
1. Will be also helpful if we can copy the record from the PS file to another JCL variable and then it will be easy to compare two variables through IF - ELSE in JCL.
OR
2. Will be also helpful if we can copy the JCL variable to a PS file and then it will be easy to compare two files through IEBCOMPR utility.
Hope its clear now. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
then it will be easy to compare two variables through IF - ELSE in JCL. |
I don't believe this will do what you want. Suggest you run an experiment of simplying trying to do the compare "in JCL".
When you create a process (if you proceed this way), you will need a "front-ende" process to read the file and generate the "real JCL". Then submit the newly created/modified JCL thru the internal reader.
If you post the pieces you already have, someone may be able to make a suggestion you can use. Also, make sure there is no rule against generating Production JCL "on the fly" on your system. |
|
Back to top |
|
|
Abhinav Chandra
New User
Joined: 13 Oct 2012 Posts: 29 Location: India
|
|
|
|
I think you still didn't get the requirement -
This piece of code works fine.
//*
// SET CDATE=0831
//*
//COMPR1 EXEC PGM=IEBCOMPR
//SYSUT1 DD DSN=Z002412.ABHI.TEST.SQLNW,DISP=OLD
//SYSUT2 DD *
0830
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
I am trying to do same with -
//*
// SET CDATE=$CQMCDATE
//*
//COMPR1 EXEC PGM=IEBCOMPR
//SYSUT1 DD DSN=Z002412.ABHI.TEST.SQLNW,DISP=OLD
//SYSUT2 DD *
&CDATE
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
I know it wont pick the correct date in sysut2. Thus looking for any other alternative to accomplish this requirement.
Please let me know for any concern in the understanding. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
You could try using your SORT product to take the symbol in a first step to generate the record for the SYSUT2 used in IEBCOMPR in a seconf step.
Garry. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
SET is used to provide values to JCL variables NOT to data. as everyone says, you can write a program (or use DFSORT) to read the PARM set nby SET and generate what you need. JCL is NOT a programming language - it only tells the system what programs you want to run, the sequence, any conditional execution and the resources required by the programs. |
|
Back to top |
|
|
|