View previous topic :: View next topic
|
Author |
Message |
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
Following is my rexx code. I will be calling this rexx from a JCL. The edit macro which i wrote accepts parameters and works accordingly.
Now, dataset opens says "string not found".
Where did i make the mistake, when passing the parameter or in the edit macro ?
Code: |
/* REXX *********************************/
/* MACRO STARTER MACRO IS A SEPARATE PRG*/
/*************************REXX************/
/*DSN=HXSULL.QUERY.REPEXCP */
ADDRESS ISPEXEC
USER = USERID()
TRACE I
PARM = "SSID INTERVAL_START"
"ISPEXEC VPUT (PARM) PROFILE"
"ISPEXEC EDIT DATASET('HXSULL.QUERY.REPEXCP') MACRO (MAC2)"
EXIT |
MAC2 macro
Code: |
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
/* "ISREDIT TOP"*/
"ISREDIT F ALL '------'"
"ISREDIT F SELECT"
"ISREDIT (TOP) = CURSOR"
"ISREDIT LABEL .ZCSR = .TOP"
"ISREDIT F X'5E' ALL"
"ISREDIT (BOTTOM) = CURSOR"
SELECT
WHEN TOP=BOTTOM THEN
DO
"ISREDIT DELETE ALL .TOP .TOP"
END
OTHERWISE
DO
"ISREDIT LABEL .ZCSR= .BOTTOM"
"ISREDIT DELETE ALL .TOP .BOTTOM"
END
END
"ISREDIT X ALL"
"ISREDIT F ALL P'DSNE6==I'"
"ISREDIT DELETE ALL NX"
"ISREDIT RESET"
"ISREDIT ONLY '----+-----'"
"ISREDIT DELETE ALL NX"
"ISREDIT ONLY "HEADER""
"ISREDIT FLIP"
"ISREDIT FIND FIRST "HEADER""
"ISREDIT DELETE ALL X"
"ISREDIT RESET"
/* "ISREDIT END" */
EXIT |
Sushanth |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
You didn't read manual SC34-4819-07. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Prino,
Is the mistake in VPUT, manual says 'specifies one or more dialog variables'. What iam passing is not a diaglog variable. Its just a variable. So, ISPFEXEC is opening the dataset, and running macro till the parameter line. So, according to the macro no parameters are being passed. So, it says "STRING NOT FOUND". And, I can remove that VPUT line. Now, how am i gonna pass the parameter ?
A help would be helpful.
Sushanth |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Go and RTFM, SC34-4819-07, it explains everything! |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thank You, Got it.
Sushanth |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Hi Sushanth,
Apparently, you need a little bit more guidance.
You use VPUT to store a value into a "pool", then you have to retrieve it later by using a VGET.
If you don't use VGET then don't use VPUT.
You don't use the USER variable, you can throw it away too.
You have TRACE I in your rexx, so you must know what it does.
Use it in your macro too.
I don't see the "/* REXX */" a the beginning of the macro.
As you modify an edited file, you should terminate with an explicit "SAVE" or "CANCEL".
This will remove any doubt.
And what happens if the string is not found? You never check any RC.
I think you should..
BTW, when a string is not found, the message "string not found" shows. How weird.
ONLY is not a standard ISPF edit command. It is certainly a local macro.
(I bet it has x all followed by find all)
Once you've finished to RTFM this book recommended by prino, you should RTFM this one... |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thank you for your guidance MARSO. |
|
Back to top |
|
|
|