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
 
Passing data from REXX to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Passing data from REXX to JCL
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: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 2:34 pm    Post subject:
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    Post subject:
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: 456
Location: Belgium

PostPosted: Tue Dec 26, 2006 4:33 pm    Post subject:
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    Post subject:
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: 456
Location: Belgium

PostPosted: Tue Dec 26, 2006 4:55 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 5:15 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Jan 03, 2007 12:25 am    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 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

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