View previous topic :: View next topic
|
Author |
Message |
Praveen India
New User
Joined: 30 Apr 2008 Posts: 2 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Praveen and welcome to the forums,
I'd suggest you post the problem code. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Praveen India
New User
Joined: 30 Apr 2008 Posts: 2 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
|