Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Selection and Execution of JCL step based on file RECFM

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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Wed May 06, 2009 4:09 am    Post subject: Selection and Execution of JCL step based on file RECFM
Reply with quote

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

mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed May 06, 2009 4:38 am    Post subject:
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 06, 2009 5:56 am    Post subject:
Reply with quote

I know it's a stupid question, but what is "TYPE A" as opposed to "VB and TYPE B"?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed May 06, 2009 6:24 am    Post subject:
Reply with quote

Hi CICS Guy,

I'm glad you asked the question, now I don't feel so stupid.


Gerry
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed May 06, 2009 6:37 am    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Wed May 06, 2009 7:58 am    Post subject:
Reply with quote

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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Wed May 06, 2009 1:18 pm    Post subject: Reply to: Selection and Execution of JCL step based on file
Reply with quote

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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Wed May 06, 2009 1:20 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed May 06, 2009 2:53 pm    Post subject:
Reply with quote

You can find IBM Manuals at the top of this page -- that IS the link.
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Wed May 06, 2009 3:45 pm    Post subject: Reply to: Selection and Execution of JCL step based on file
Reply with quote

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

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu May 07, 2009 6:52 am    Post subject: Reply to: Selection and Execution of JCL step based on file
Reply with quote

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
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us