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

Selection and Execution of JCL step based on file RECFM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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: 2146
Location: At my coffee table

PostPosted: Wed May 06, 2009 5:56 am
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: 1702
Location: Australia

PostPosted: Wed May 06, 2009 6:24 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 06, 2009 6:37 am
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

Moderator Emeritus


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

PostPosted: Wed May 06, 2009 7:58 am
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 06, 2009 2:53 pm
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
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: 400
Location: Mumbai

PostPosted: Thu May 07, 2009 6:52 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top