Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comparing file record with JCL variable through JCL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Abhinav Chandra

New User


Joined: 13 Oct 2012
Posts: 29
Location: India

PostPosted: Wed Sep 11, 2013 12:01 am    Post subject: Comparing file record with JCL variable through JCL ?
Reply with quote

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 !! icon_biggrin.gif
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Wed Sep 11, 2013 1:23 am    Post subject: Reply to: Comparing file record with JCL variable through JC
Reply with quote

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

New User


Joined: 13 Oct 2012
Posts: 29
Location: India

PostPosted: Wed Sep 11, 2013 1:42 am    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Wed Sep 11, 2013 1:49 am    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Wed Sep 11, 2013 1:53 am    Post subject: Reply to: Comparing file record with JCL variable through JC
Reply with quote

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

New User


Joined: 13 Oct 2012
Posts: 29
Location: India

PostPosted: Wed Sep 11, 2013 2:07 am    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Wed Sep 11, 2013 2:43 am    Post subject:
Reply with quote

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

New User


Joined: 13 Oct 2012
Posts: 29
Location: India

PostPosted: Wed Sep 11, 2013 12:16 pm    Post subject:
Reply with quote

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

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Sep 11, 2013 12:40 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Wed Sep 11, 2013 4:56 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us