View previous topic :: View next topic
|
Author |
Message |
Vasanthr
New User
Joined: 24 Jan 2011 Posts: 21 Location: India
|
|
|
|
Hi All, I am trying to open a pds member and change a particular dataset name in the pds member to the dataset name which I am passing as argument through rexx. However I dont want the pds member to be saved after the rexx run with new dataset name. I just want the member to be viewed with changes made so that I can change something else if required manually and submit the job in the pds member myself.The pds member has a simple sort JCl in it and this needs to modified with dataset name i pass as argument every time I call the rexx.
When I execute the below code my pds member opens successfully but the change command did not work. Could you please help me on what is the problem in the below code.
Code: |
/*rexx*/
PARSE ARG DS
PDSNAME='TEST.DT.HY.R1234'
MEMBR='SORTJCL'
ADDRESS ISPEXEC
ISPEXEC "LMINIT DATAID("DATID") DATASET('"PDSNAME"') ENQ(SHR)"
ISPEXEC "LMOPEN DATAID("DATID") OPTION(INPUT)"
ISPEXEC "LMMFIND DATAID("DATID") MEMBER("MEMBR") STATS(YES)"
IF RC = 0 THEN
DO
ISPEXEC "EDIT DATAID("DATID") MEMBER("MEMBR")"
ADDRESS ISREDIT "C ALL 'ABC.DT.XF' &DS"
ADDRESS ISREDIT "CANCEL"
RETURN
END |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I believe hat your change command should be within an edit macro. Once your edit statement has finished execuing and you try to exeute the change the edit has already finished. Either use a macro, and/or use VIEW or use file tailoring (instead of submitting the tailored file you can edit it instead and do your changes and submit or cancel at that point) |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Your edit statement:
Code: |
ISPEXEC "EDIT DATAID("DATID") MEMBER("MEMBR")" |
should also have the MACRO(abc) parameter. And the specified macro should have your change statements.
and..
Quote: |
I just want the member to be viewed with changes made... |
Your edit macro cannot include the CANCEL statement or the user will never see the JCL. Instead of using CANCEL, add this:
Code: |
"DEFINE END ALIAS CANCEL" |
When the user press F3 to End, it will not save the file. Perhaps also:
Code: |
"DEFINE SAVE ALIAS CANCEL" |
|
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Pedro wrote: |
Your edit statement:
Code: |
ISPEXEC "EDIT DATAID("DATID") MEMBER("MEMBR")" |
should also have the MACRO(abc) parameter. And the specified macro should have your change statements.
and..
Quote: |
I just want the member to be viewed with changes made... |
Your edit macro cannot include the CANCEL statement or the user will never see the JCL. Instead of using CANCEL, add this:
Code: |
"DEFINE END ALIAS CANCEL" |
When the user press F3 to End, it will not save the file. Perhaps also:
Code: |
"DEFINE SAVE ALIAS CANCEL" |
|
If the TS only wants to see the changes and has no intention of saving them, why the flupping 'ell doesn't he use
Code: |
ISPEXEC "VIEW DATAID("DATID") MEMBER("MEMBR") macro(whatever)" |
AND WHY DO PEOPLE STILL SCREAM WHEN WRITING REXX? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Maybe "Caps Lock"? Maybe because used to COBOL upper-case? |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Terry Heinze wrote: |
Maybe "Caps Lock"? Maybe because used to COBOL upper-case? |
My earliest Rexx programs were written in all caps, but I soon abandoned that style. But I still find myself uppercasing important commands and keywords, especially when invoking ISPF services. There is no good reason to do that, especially when you use HILITE REXX in your edit session. I used to scream when counting Rexx quotation marks, but HILITE REXX cured me of that affliction. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I have a vague recollection that ISPF services calls should be in uppercase to support users that run in DBCS mode. Sorry, I am an old geezer and cannot remember more details. :-)
I Code In "Camel-Case", With The First Letter Of Every Language Keyword Being Capitalized. Yeah, I Am Crazy. I have a macro that helps me. |
|
Back to top |
|
|
Vasanthr
New User
Joined: 24 Jan 2011 Posts: 21 Location: India
|
|
|
|
Thanks Everyone. I was able to execute the macro successfully using the macro in the view command itself.
Code: |
ISPEXEC "VIEW DATAID("DATID") MEMBER("MEMBR") MACRO(CHNG) PARM(DS)" |
|
|
Back to top |
|
|
|