Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Submitting REXX in Batch mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Praveen India

New User


Joined: 30 Apr 2008
Posts: 2
Location: Bangalore

PostPosted: Thu May 01, 2008 8:32 am    Post subject: Submitting REXX in Batch mode
Reply with quote

I have a REXX exec that I want to submit in batch mode.

When running it in batch mode, the following things are erroring out:

1) ALLOC statement inside REXX to allocate a dataset
2) VGET and VPUT functions (Passing value to a macro)

they give me a RC(-3)
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: Thu May 01, 2008 8:44 am    Post subject:
Reply with quote

Hello Praveen and welcome to the forums,

I'd suggest you post the problem code.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Thu May 01, 2008 9:35 am    Post subject: Reply to: Submitting REXX in Batch mode
Reply with quote

There are two ways you can run a REXX exec in batch:

- IRXJCL. This is the REXX interpreter program. It does not setup a TSO address space, so any REXX exec you run here cannot contain commands for other environments, such as TSO and ISPF. There is no particular reason to use IRXJCL if you intend to use TSO commands.

- IKJEFT01. This is the TSO Terminal Monitor Program (TMP). This program sets up a TSO address space, allowing any REXX exec you run here to use TSO commands. This is usually the preferred program to use.

In addition, you can write programs that use ISPF Services. Whether they are compiled programs, or interpreted, the one thing that must be done is that ISPF must be started. Since ISPF also requires TSO, you need to use the IKJEFT01 program. You must use the ISPSTART command to start ISPF before your program, then you normally use the SELECT CMD or SELECT PGM service to activate your program. Your JCL must contain DD statements for all of the required and optional ISPF libraries that you will be using.

Some similar topics you should review:

REXX Program run.

TSO ? ISPF ? REXX ? Keeping them Straight.

Difference between IKJEFT1B and IKJEFT01.

Running REXX pgm having ispexec in Batch mode.

LMINIT returning -3 RC in BATCH.
Back to top
View user's profile Send private message
Praveen India

New User


Joined: 30 Apr 2008
Posts: 2
Location: Bangalore

PostPosted: Fri May 02, 2008 3:24 pm    Post subject: Reply to: Submitting REXX in Batch mode
Reply with quote

Thanks Dick...



1)I want to delete the dataset first if it already exists and then allocate it.
2) Copy the skel to the temporary dataset
3) Edit the temp dataset with the Macro ( for this I am passing the values using VPUT to the macro)
4) The macro gets the value using VGET and edits the skel with the actual values.
5) copy the member created in the temp dataset to the actual dataset


This is the code that troubles me...
-----------------------------------------------------------------------------------
REXX code.

Code:

PDS = SYSDSN("'PRAVEEN.TEMPCOPY'")                               
IF PDS = OK THEN DO                                               
DELETE "'PRAVEEN.TEMPCOPY'" PURGE                                 
END                                                               
CALL OUTTRAP "OFF"                                               
"ALLOC F(TMPFILE) DA('PRAVEEN.TEMPCOPY') NEW CATALOG LRECL(80)   
 BLKSIZE(8000) RECFM(F B) DSORG(PO) CYL SPACE(5 5) DIR(30)"       
                                                                 
"QACOPY 'PRAVEEN.SKEL("DLYMEM")' 'PRAVEEN.TEMPCOPY("A4")' NONUM"
                                                                 
"ISPEXEC VPUT (DVOC DVBK)"                                           
"FREE ALL"                                                                 
"ALLOC DA('PRAVEEN.TEMPCOPY') F(DIDIN) SHR REUSE"                   
"ISPEXEC EDIT DATASET('PRAVEEN.TEMPCOPY("A4")') MACRO(DMACRO)"   
 "FREE ALL"                                                       


MACRO :

Code:

/******* REXX ******/           
"ISREDIT MACRO"                                                 
"ISPEXEC CONTROL ERRORS RETURN"                                 
"ISPEXEC VGET (DVOC DVBK BAOC)"                                         
"ISREDIT CHANGE ALL "DVOC1" "DVOC""                             
"ISREDIT CHANGE ALL "DVBK1" "DVBK""                             
"ISREDIT CHANGE ALL "BAOC1" "BAOC""                             
"ISREDIT SAVE"                                                   
"ISREDIT END"                                                   
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Fri May 02, 2008 7:31 pm    Post subject: Reply to: Submitting REXX in Batch mode
Reply with quote

The forum will have to assume that you've tested the macro already and that it's working as designed.

It might be nice if you could post a run-time trace of this code. Nothing jumps out as a potential problem, except this:

You VPUT only two variables

"ISPEXEC VPUT (DVOC DVBK)"

but you VGET three

"ISPEXEC VGET (DVOC DVBK BAOC)"

The missing variable will cause a RC=4 on the VGET call.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri May 02, 2008 11:03 pm    Post subject:
Reply with quote

Only one point I would make,
Code:

PDS = SYSDSN("'PRAVEEN.TEMPCOPY'")                               
IF PDS = OK THEN DO                                               
DELETE "'PRAVEEN.TEMPCOPY'" PURGE                                 
END     

I would just use the DELETE statement, if the dataset does not exist then nothing untoward happens, and if it does exist, it gets deleted.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 2 Wed Jul 26, 2017 9:11 pm
No new posts Passing data from REXX to C programme... chong.zhou All Other Mainframe Topics 0 Wed Jul 26, 2017 4:55 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us