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

Passing data from REXX to JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sangeethaji

New User


Joined: 26 Dec 2006
Posts: 6
Location: Chennai

PostPosted: Tue Dec 26, 2006 1:46 pm
Reply with quote

Hi

Is it possible to get pass parameters from rexx to jcl?

for example:
I have a jcl to count the number of records. I need to use REXX to get the name of the dataset from the user and pass it to the JCL.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Dec 26, 2006 2:34 pm
Reply with quote

I'm not sure I understand your question. How are you going to invoke this REXX? How do you get the parameters from the user?

O.
Back to top
View user's profile Send private message
sangeethaji

New User


Joined: 26 Dec 2006
Posts: 6
Location: Chennai

PostPosted: Tue Dec 26, 2006 2:46 pm
Reply with quote

Hi

Actually I dont know much about REXX, and I want to create a small tool which will get the input from the user and give the output. so is there any way to do it?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Dec 26, 2006 4:33 pm
Reply with quote

Quote:
Actually I dont know much about REXX
neither JCL which is Job Control Language.
Please explain more : background? foreground? In one case, JCL is not directly not requested. Thru panel?

Is that
Quote:
Is it possible to get pass parameters from rexx to jcl?

the right direction , not the inverse?
Back to top
View user's profile Send private message
sangeethaji

New User


Joined: 26 Dec 2006
Posts: 6
Location: Chennai

PostPosted: Tue Dec 26, 2006 4:44 pm
Reply with quote

I want to create a tool( to count the records in a dataset) which should do the following:


1. Get the name of the dataset from the user
2. count the records
3. display the no of records to the user

can I do all of these in REXX program itself and need not involve jcl at all?
if i can do this in REXX, how should i run the program?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Dec 26, 2006 4:55 pm
Reply with quote

Some points. Do you want to achieve this giving a panel to the user or - shorter - via PULL and SAY commands? or in batch?

Are you aware of existence of pure SAM files, VSAM files ( of any kind ), or PDS ? or even unexisting file? File on disk or on tape? Directly available or migrated? The way to retrieve the number of records will be significantly different.

Just to show you a single question can be a little more complicated.

Cheers

Pierre
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Dec 26, 2006 5:15 pm
Reply with quote

First, you have to check the organization of the dataset. For this you can use either LISTDSI or ISPF's LMDLIST service.

Then, you can either EXECIO and display the .0 valiable, or calculate the number of records based on LRECL, RECFM and size. Alternatively, you can invoke LISTCAT from within REXX and parse the results.

Another option is to use edit-macro (where .ZL is the number of records).

O.
Back to top
View user's profile Send private message
Ken_Fraser

New User


Joined: 02 Jan 2007
Posts: 5
Location: UK

PostPosted: Tue Jan 02, 2007 11:03 pm
Reply with quote

Here's something to get you going. It'll give you the record count for a QSAM file.

Code:
/* rexx */                                                       
/* Get filename from user.                                       
   Allocate and read file into data. stem then free the file.   
   Record count is in data.0 */                                 
                                                                 
   say "Enter filename (no quotes) :"                           
   pull filename                                                 
   ADDRESS TSO "ALLOC FI(TEMP) DA('"filename"') SHR REU"
  "EXECIO * DISKR TEMP (STEM data. FINIS"                       
   ADDRESS TSO "FREE  FI(TEMP)"                                 
   say filename " contains " data.0 " records."                 
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 03, 2007 12:25 am
Reply with quote

Ken -

Depending on the size allocated for the address space, the EXECIO might give an error for huge files. It is always a good practice to check the EXECIO's RC when the estimated file size is unknown, and if the file is too big, you can allways read it in batches (I usually use 10,000 records groups).

O.
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top