View previous topic :: View next topic
|
Author |
Message |
sangeethaji
New User
Joined: 26 Dec 2006 Posts: 6 Location: Chennai
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
sangeethaji
New User
Joined: 26 Dec 2006 Posts: 6 Location: Chennai
|
|
|
|
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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
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 |
|
|
sangeethaji
New User
Joined: 26 Dec 2006 Posts: 6 Location: Chennai
|
|
|
|
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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
Ken_Fraser
New User
Joined: 02 Jan 2007 Posts: 5 Location: UK
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
|