Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1249
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: 1249
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: 658
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: 1249
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: 2088
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 ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 17 Sat Nov 18, 2017 7:40 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us