This is just to find out if the behavior of a macro in a define is
normal. I can work around it and so there is no major problem. I have the following macro and macro call. VECTOR V=V1 TO V1530. DEFINE GRAPHGAUS (ARG1 = !TOKENS(1) / ARG2 = !TOKENS(1)) !DO !i = !ARG1 !TO !ARG2 GRAPH / SCATTERPLOT=PIXEL WITH !CONCAT(V,!i). !DOEND !ENDDEFINE. *GRAPHGAUS ARG1=1 ARG2=1530. This macro will produce 1530 graphs in one run. Whenever I do not want a procedure to run, like LIST or REGRESSION, I make it a comment. This always works. But it doesn't work when I comment out the GRAPHGAUS macro call. I have to put a space somewhere in the macro name so it is not recognized as a macro call. Are the arguments in a macro call being passed to the macro when the call is made into a comment the way the macro call is supposed to work? Stan ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
This post was updated on .
Try this:
/* GRAPHGAUS ARG1=1 ARG2=1530. */ IIRC, that is the only style of commenting that prevents macros from executing. EDIT. See also this Technote: https://www-01.ibm.com/support/docview.wss?uid=swg21479589 Stan Gorodenski wrote > This is just to find out if the behavior of a macro in a define is > normal. I can work around it and so there is no major problem. > > I have the following macro and macro call. > > VECTOR V=V1 TO V1530. > DEFINE GRAPHGAUS (ARG1 = !TOKENS(1) > / ARG2 = !TOKENS(1)) > !DO !i = !ARG1 !TO !ARG2 > GRAPH / SCATTERPLOT=PIXEL WITH !CONCAT(V,!i). > !DOEND > !ENDDEFINE. > > *GRAPHGAUS ARG1=1 ARG2=1530. > > This macro will produce 1530 graphs in one run. Whenever I do not want a > procedure to run, like LIST or REGRESSION, I make it a comment. This > always works. But it doesn't work when I comment out the GRAPHGAUS macro > call. I have to put a space somewhere in the macro name so it is not > recognized as a macro call. Are the arguments in a macro call being > passed to the macro when the call is made into a comment the way the > macro call is supposed to work? > Stan > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD ----- -- Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Thanks, Bruce. That worked.
Stan On 8/6/2018 1:07 PM, Bruce Weaver wrote: > Try this: > > /* GRAPHGAUS ARG1=1 ARG2=1530. */ > > IIRC, that is the only style of commenting that prevents macros from > executing. > > > > Stan Gorodenski wrote > >> This is just to find out if the behavior of a macro in a define is >> normal. I can work around it and so there is no major problem. >> >> I have the following macro and macro call. >> >> VECTOR V=V1 TO V1530. >> DEFINE GRAPHGAUS (ARG1 = !TOKENS(1) >> / ARG2 = !TOKENS(1)) >> !DO !i = !ARG1 !TO !ARG2 >> GRAPH / SCATTERPLOT=PIXEL WITH !CONCAT(V,!i). >> !DOEND >> !ENDDEFINE. >> >> *GRAPHGAUS ARG1=1 ARG2=1530. >> >> This macro will produce 1530 graphs in one run. Whenever I do not want a >> procedure to run, like LIST or REGRESSION, I make it a comment. This >> always works. But it doesn't work when I comment out the GRAPHGAUS macro >> call. I have to put a space somewhere in the macro name so it is not >> recognized as a macro call. Are the arguments in a macro call being >> passed to the macro when the call is made into a comment the way the >> macro call is supposed to work? >> Stan >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to >> > >> LISTSERV@.UGA >> > >> (not to SPSSX-L), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSX-L >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD >> > > > > > ----- > -- > Bruce Weaver > [hidden email] > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > Sent from: http://spssx-discussion.1045642.n5.nabble.com/ > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
In reply to this post by Bruce Weaver
Yep. And it should probably be !GRAPHGAUS for obvious reasons.
----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
It works without the ! and the command syntax guide does not have the !
in their macro call. I'm using ver 21. Is the ! required in newer versions? Stan On 8/6/2018 1:35 PM, David Marso wrote: > Yep. And it should probably be !GRAPHGAUS for obvious reasons. > > > > ----- > Please reply to the list and not to my personal email. > Those desiring my consulting or training services please feel free to email me. > --- > "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." > Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" > -- > Sent from: http://spssx-discussion.1045642.n5.nabble.com/ > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Starting the name with ! is just a convention. It is not and never has been a requirement. The reason to use it is to minimize the chance of colliding with other objects such as variable names where the ! is not allowed. On Mon, Aug 6, 2018 at 3:03 PM Stan Gorodenski <[hidden email]> wrote: It works without the ! and the command syntax guide does not have the ! |
From what you said, I thought it might be nice to start the macro call
with a ! so it is easier to recognize it as a macro call. It didn't work. I got a message that said "The first word in the line is not recognized as an SPSS statistics command." I reran it without the ! and it worked. Again, I'm running version 21. Could this be the reason it is not working? Stan On 8/6/2018 3:48 PM, Jon Peck wrote: > Starting the name with ! is just a convention. It is not and never > has been a requirement. The reason to use it is to minimize the > chance of colliding with other objects such as variable names where > the ! is not allowed. > > On Mon, Aug 6, 2018 at 3:03 PM Stan Gorodenski <[hidden email] > <mailto:[hidden email]>> wrote: > > It works without the ! and the command syntax guide does not have > the ! > in their macro call. I'm using ver 21. Is the ! required in newer > versions? > Stan > > > On 8/6/2018 1:35 PM, David Marso wrote: > > Yep. And it should probably be !GRAPHGAUS for obvious reasons. > > > > > > > > ----- > > Please reply to the list and not to my personal email. > > Those desiring my consulting or training services please feel > free to email me. > > --- > > "Nolite dare sanctum canibus neque mittatis margaritas vestras > ante porcos ne forte conculcent eas pedibus suis." > > Cum es damnatorum possederunt porcos iens ut salire off > sanguinum cliff in abyssum?" > > -- > > Sent from: http://spssx-discussion.1045642.n5.nabble.com/ > > > > ===================== > > To manage your subscription to SPSSX-L, send a message to > > [hidden email] <mailto:[hidden email]> > (not to SPSSX-L), with no body text except the > > command. To leave the list, send the command > > SIGNOFF SPSSX-L > > For a list of commands to manage subscriptions, send the command > > INFO REFCARD > > > > > > > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] <mailto:[hidden email]> (not > to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > > > -- > Jon K Peck > [hidden email] <mailto:[hidden email]> > > ===================== To manage your subscription to SPSSX-L, send a > message to [hidden email] > <mailto:[hidden email]> (not to SPSSX-L), with no body text > except the command. To leave the list, send the command SIGNOFF > SPSSX-L For a list of commands to manage subscriptions, send the > command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
If you use the ! both in the define command and in execution, it will be recognized. Use SET MPRINT ON. to see exactly how the macro expands. On Tue, Aug 7, 2018 at 1:02 PM Stan Gorodenski <[hidden email]> wrote: From what you said, I thought it might be nice to start the macro call |
Thanks. That worked and I'll use it, but cannot use the MPRINT ON
setting. Each output line begins with M> and it jumbles things enough, like some of my comments, that make it difficult to read the output. Stan On 8/7/2018 12:29 PM, Jon Peck wrote: > If you use the ! both in the define command and in execution, it will > be recognized. Use SET MPRINT ON. to see exactly how the macro expands. > > On Tue, Aug 7, 2018 at 1:02 PM Stan Gorodenski <[hidden email] > <mailto:[hidden email]>> wrote: > > From what you said, I thought it might be nice to start the macro > call > with a ! so it is easier to recognize it as a macro call. It didn't > work. I got a message that said "The first word in the line is not > recognized as an SPSS statistics command." I reran it without the > ! and > it worked. Again, I'm running version 21. Could this be the reason > it is > not working? > Stan > > > On 8/6/2018 3:48 PM, Jon Peck wrote: > > Starting the name with ! is just a convention. It is not and never > > has been a requirement. The reason to use it is to minimize the > > chance of colliding with other objects such as variable names where > > the ! is not allowed. > > > > On Mon, Aug 6, 2018 at 3:03 PM Stan Gorodenski > <[hidden email] <mailto:[hidden email]> > > <mailto:[hidden email] <mailto:[hidden email]>>> > wrote: > > > > It works without the ! and the command syntax guide does not > have > > the ! > > in their macro call. I'm using ver 21. Is the ! required in > newer > > versions? > > Stan > > > > > > On 8/6/2018 1:35 PM, David Marso wrote: > > > Yep. And it should probably be !GRAPHGAUS for obvious reasons. > > > > > > > > > > > > ----- > > > Please reply to the list and not to my personal email. > > > Those desiring my consulting or training services please feel > > free to email me. > > > --- > > > "Nolite dare sanctum canibus neque mittatis margaritas vestras > > ante porcos ne forte conculcent eas pedibus suis." > > > Cum es damnatorum possederunt porcos iens ut salire off > > sanguinum cliff in abyssum?" > > > -- > > > Sent from: http://spssx-discussion.1045642.n5.nabble.com/ > > > > > > ===================== > > > To manage your subscription to SPSSX-L, send a message to > > > [hidden email] <mailto:[hidden email]> > <mailto:[hidden email] <mailto:[hidden email]>> > > (not to SPSSX-L), with no body text except the > > > command. To leave the list, send the command > > > SIGNOFF SPSSX-L > > > For a list of commands to manage subscriptions, send the command > > > INFO REFCARD > > > > > > > > > > > > > ===================== > > To manage your subscription to SPSSX-L, send a message to > > [hidden email] <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> (not > > to SPSSX-L), with no body text except the > > command. To leave the list, send the command > > SIGNOFF SPSSX-L > > For a list of commands to manage subscriptions, send the command > > INFO REFCARD > > > > > > > > -- > > Jon K Peck > > [hidden email] <mailto:[hidden email]> > <mailto:[hidden email] <mailto:[hidden email]>> > > > > ===================== To manage your subscription to SPSSX-L, > send a > > message to [hidden email] > <mailto:[hidden email]> > > <mailto:[hidden email] > <mailto:[hidden email]>> (not to SPSSX-L), with no body > text > > except the command. To leave the list, send the command SIGNOFF > > SPSSX-L For a list of commands to manage subscriptions, send the > > command INFO REFCARD > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] <mailto:[hidden email]> (not > to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > > > -- > Jon K Peck > [hidden email] <mailto:[hidden email]> > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
MPRINT ON is only intended for debugging purposes. It has no effect on the actual workings or expansion of the macro. On Tue, Aug 7, 2018 at 1:42 PM Stan Gorodenski <[hidden email]> wrote: Thanks. That worked and I'll use it, but cannot use the MPRINT ON |
Free forum by Nabble | Edit this page |