View previous topic :: View next topic
|
Author |
Message |
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
Hi,
I do have the following requirement:
I do have 4 JCL steps. OLnly of the JCL steps should be executed based on the input dataset RECFM (FB or VB) and if the dataset type is TYPE A or TYPE B(which is already known).
If the file is of RECFM=FB and TYPE A, Execute STEP1.
If the file is of RECFM=FB and TYPE B, Execute STEP2.
If the file is of RECFM=VB and TYPE A, Execute STEP3.
If the file is of RECFM=VB and TYPE B, Execute STEP4.
As I want to perform this for a large number of files, I want to create a JCLPROC to perform this.
Can you please provide me with a JCLPROC to perform the above operation.
Also,
The file type (TYPE A or TYPE B) can be passed as a parameter to the JCLPROC.
But can we do the process of identifying whether the dataset is FB or VB using some JCL utility or REXX.
So, I want to just pass the dataset name and the File type to the JCLPROC and it should be able to perform the operation.
Is this possible in JCL? If so, can you please help me in creating such a JCLPROC.
Thanks,
OP |
|
Back to top |
|
|
mtaylor
Active User
Joined: 20 Feb 2009 Posts: 108 Location: Kansas City
|
|
|
|
Use the manual link above to research the IF/THEN/ELSE/ENDIF (chapter 17) construct and the COND parameter of the EXEC statement. You will see that what you describe is not possible using JCL.
You may be able to get close using a program that checks the files that are available and setting a return code that later IF's or COND evaluate. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
I know it's a stupid question, but what is "TYPE A" as opposed to "VB and TYPE B"? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi CICS Guy,
I'm glad you asked the question, now I don't feel so stupid.
Gerry |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I know it's a stupid question |
CICS Guy, when I was teaching I used to tell my students there was no such thing as a stupid question (at least until I heard one, after which I started telling them they weren't likely to have the second one). Especially when somebody else is also asking -- then it definitely is not a stupid question.
Although, based on what we've seen so far, I may have to invoke rule #1 (which I used at a previous employer who had a tendency, at least overseas, of hiring people off the street and telling them they were programmers) -- NEVER ASK WHY! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest that the typeA and typeB are external to the file attributes (i.e. not something in the dcb or vtoc or the catalog, etc.). Say a "people" file and a "thing" - 2 types of data.
I'd probably use a 5-step process which would have the first step using a parm of type and dataset name. The first step would be code that would use the dsn and determine fb or vb. Then, with the type from the parm and the fb/vb from the system, i'd set a return-code of 100, 200, 300, or 400 for the 4 conditions. STEP1/2/3/4 each would execute depending on the condition code. |
|
Back to top |
|
|
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
Hello Robert and Scherrer,
Thanks for clarifying the TYPE A and TYPE B issue.
I am sorry I didnt mention this properly in my query. It is exactly as Scherrer mentioned.
Every file for which I am doing to the above operation, I would pass the Dataset name and the file type "people" or "thing" to the PROC.
But can you please tell me how can we identify if the RECFM of the file is FB or VB using any JCL functions.
Thanks,
OP |
|
Back to top |
|
|
op
New User
Joined: 31 Oct 2006 Posts: 48 Location: Chennai
|
|
|
|
mtaylor wrote: |
Use the manual link above to research the IF/THEN/ELSE/ENDIF (chapter 17) construct and the COND parameter of the EXEC statement. |
Can you please provide the link. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You can find IBM Manuals at the top of this page -- that IS the link. |
|
Back to top |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
I don't think there is anyt utilty which can be used directly to find the recfm of a dataset, you need to write a program and set up the return code. Process the return code in following steps. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
suggestion to write a small rexx program to analyse the data set and, as others have said, set a return code whcih is used by later steps. Depending on how TYPE is defined, it may only be a few lines of rexx. |
|
Back to top |
|
|
|