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
 

 

Resolving nested symbolic variables in an edit macro

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

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Nov 13, 2013 8:24 am    Post subject: Resolving nested symbolic variables in an edit macro
Reply with quote

I have the following edit macro:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
ISREDIT MACRO
SET ME=&&SYSUID
ISREDIT LINE_AFTER 0 = "//&SYSUID.XX JOB (YYY,ZZZ),+
                       'PROGRAMMER',"
ISREDIT LINE_AFTER 1 = "//             CLASS=B,"           /* JOB
ISREDIT LINE_AFTER 2 = "//             MSGCLASS=H,"        /* STATEMENT
ISREDIT LINE_AFTER 3 = "//*            RESTART=XXXXXXXX,"  /* AND
ISREDIT LINE_AFTER 4 = "//             TYPRUN=SCAN,"       /* PARAMETERS
ISREDIT LINE_AFTER 5 = "//             NOTIFY=&ME"
ISREDIT LINE_AFTER 6 = "//*"
SET &ZEDSMSG = JOB STATEMENT INSERTED               /* FILL    SHORT MSG
SET &ZEDLMSG = A JOB STATEMENT HAS BEEN INSERTED AT THE BEGINNING +
               OF THIS DATASET                      /* FILL LONG     MSG
ISPEXEC SETMSG MSG(ISRZ000)                         /* DISPLAY SHORT MSG

but am unable to get the NOTIFY value to resolve to NOTIFY=&SYSUID. I've tried every combination of single and double &s I can think of but all attempts have resulted in my TSO user ID instead of &SYSUID ending up in the NOTIFY line. I had this working many years ago but lost my original code so am trying to recreate it. I've read the Edit Macro manual and looked at the 5 examples but still can't get it to work.
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: Wed Nov 13, 2013 12:32 pm    Post subject:
Reply with quote

Hi Terry,

You can pass paramaters to macros
Code:

"ISPEXEC EDIT DATASET('"UID".WORKUSER') MACRO(MACRES00) PARM(XXXX)"


Code:

"ISREDIT MACRO (XXXX)"

And can use the variable name XXXX in the macro code

Another solution might be to use VPUT in the calling REXX or whatever and VGET in the macro

As a side question, what do you want SYSUID to resolve to, as I use that particular SYSVAR to get the TSO ID of a user
Code:
SAY 'USER ID           = ' SYSVAR(SYSUID)
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Nov 13, 2013 5:54 pm    Post subject:
Reply with quote

I intended for it to be NOTIFY=&SYSUID so anyone could use the macro asis and if someone else copied it to their own SYSPROC concatenated DD, they wouldn't need to change the NOTIFY parameter -- it would be ready to go asis. I thought that my old version of this edit macro resolved &&SYSUID to &SYSUID when executed. It seems that the scanner now keeps resolving multiple &s until ALL of them are resolved. This was an old edit macro I found in Mainframe Journal (back when it had that name).
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Wed Nov 13, 2013 7:01 pm    Post subject:
Reply with quote

I haven't written a CLIST is a long time (much prefer Rexx) but there is a built in string function that suppressed variable substitution.

&SYSNSUB(level, expression) If you set level = 0, it suppresses symbolic substitution within expression.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Nov 13, 2013 8:44 pm    Post subject:
Reply with quote

After many more attempts, finally got it working. icon_smile.gif
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
/*                                                                    */
/*  THJS     -  INSERT A JOB STATEMENT AT THE BEGINNING OF THE        */
/*              DATASET BEING EDITED.                                 */
/*                                                                    */
/*  AUTHOR   -  MAINFRAME JOURNAL                                     */
/*  CREATED  -  12/07/1989                                            */
/*  CHANGED  -  11/13/2013                                            */
/*                                                                    */
ISREDIT MACRO
SET ME = &NRSTR(&&&&SYSUID)
ISREDIT LINE_AFTER 0 = "//&SYSUID.XX JOB (AAAAA,BBBB),+
                       'YOUR NAME'," /* <-- CHANGE THIS PARM
ISREDIT LINE_AFTER 1 = "//             CLASS=B,"           /* JOB
ISREDIT LINE_AFTER 2 = "//             MSGCLASS=H,"        /* STATEMENT
ISREDIT LINE_AFTER 3 = "//*            RESTART=XXXXXXXX,"  /* AND
ISREDIT LINE_AFTER 4 = "//             TYPRUN=SCAN,"       /* PARAMETERS
ISREDIT LINE_AFTER 5 = "//             NOTIFY=&ME"
ISREDIT LINE_AFTER 6 = "//*"
SET &ZEDSMSG = JOB STATEMENT INSERTED               /* FILL    SHORT MSG
SET &ZEDLMSG = A JOB STATEMENT HAS BEEN INSERTED AT THE BEGINNING +
               OF THIS DATASET                      /* FILL LONG     MSG
ISPEXEC SETMSG MSG(ISRZ000)                         /* DISPLAY SHORT MSG

I tried learning REXX to do this, but it seemed much simpler with an old-fashioned edit macro for this purpose. Thanks everyone for your help.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Nov 13, 2013 9:48 pm    Post subject: Reply to: Resolving nested symbolic variables in an edit mac
Reply with quote

Quote:
I tried learning REXX to do this, but it seemed much simpler with an old-fashioned edit macro for this purpose


Rexx and edit macros are not mutually exclusive. You can write editor macros in rexx. Though, I think you will still have a similar problem of resolving ampersands. It is done by ISPF regardless of the language of the macro.

Whenever confronted with this &ampersand issue, I use a different character in the macro statement, then change it to be the ampersand:
Code:
/* rexx*/
Address ISREDIT                               
"MACRO"                                       
"LINE_before 2 = < 1 '//~~SYSUID.X JOB '    >"
"C '~~' '&' "                                 

It works in the change statement because the quoted ampersand does not appear to be an actual variable.
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm
No new posts Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm


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