comments within commands .

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

comments within commands .

Catherine Kubitschek
I'm trying to comment out part of a command in situ but I'm not having much
luck getting it to run.

match files file=Acad_013   /in=in013
            /table=Acad_Tce  /in=inTce
            /*   /table=Acad_2006 /in=in2006 */
            /by Id .

The error message I'm getting indicates that the comment is ending the
match files command.

I think I'm reading the Command Syntax Reference correctly but I must be
missing something.

"Use /* and */ to set off a comment within a command. The comment can be
placed wherever a
blank is valid (except within strings) and should be preceded by a blank."
- SPSS 14.0 Command Syntax Reference, p.257

Thanks in advance for any help.


Catherine Kubitschek         ([hidden email])
Sr. Programmer/Analyst        574/631-3550
Institutional Research
210 Flanner Hall
University of Notre Dame
Notre Dame, IN  46556-5611
Reply | Threaded
Open this post in threaded view
|

Re: comments within commands .

Richard Ristow
At 09:42 PM 9/24/2007, Catherine Kubitschek wrote:

>I'm trying to comment out part of a command in situ but I'm not having
>much luck getting it to run.
>
>match files file=Acad_013   /in=in013
>            /table=Acad_Tce  /in=inTce
>            /*   /table=Acad_2006 /in=in2006 */
>            /by Id .
>
>The error message I'm getting indicates that the comment is ending the
>match files command.

I'm afraid that's just what happens. As you quote from the Command
Syntax Reference, "The comment can be placed wherever a blank is
valid." Unfortunately, as a corollary or implementation quirk, for
parsing of code, a comment *IS* a blank. So your command is parsed as

match files file=Acad_013   /in=in013
            /table=Acad_Tce  /in=inTce

            /by Id .

and the blank line ends it. I'd like to do what you want to, too, but
anyway, this should work (but untested):

match files file=Acad_013   /in=in013
            /table=Acad_Tce  /in=inTce
            /*   /table=Acad_2006 /in=in2006 */ /by Id .

>I think I'm reading the Command Syntax Reference correctly but I must
>be missing something.

I guess this implementation of "/*.*/" comments could be said to be
implied in the documentation, but I found it out by trial and error,
myself.

-Good luck and best wishes,
  Richard
Reply | Threaded
Open this post in threaded view
|

Re: comments within commands .

Fry, Jonathan B.
In reply to this post by Catherine Kubitschek
I suspect that something inside is replacing the comment by a blank, leaving the line entirely blank.  A blank line is a command separator.

Jonathan Fry
SPSS Inc.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Catherine Kubitschek
Sent: Monday, September 24, 2007 8:42 PM
To: [hidden email]
Subject: comments within commands .

I'm trying to comment out part of a command in situ but I'm not having much
luck getting it to run.

match files file=Acad_013   /in=in013
            /table=Acad_Tce  /in=inTce
            /*   /table=Acad_2006 /in=in2006 */
            /by Id .

The error message I'm getting indicates that the comment is ending the
match files command.

I think I'm reading the Command Syntax Reference correctly but I must be
missing something.

"Use /* and */ to set off a comment within a command. The comment can be
placed wherever a
blank is valid (except within strings) and should be preceded by a blank."
- SPSS 14.0 Command Syntax Reference, p.257

Thanks in advance for any help.


Catherine Kubitschek         ([hidden email])
Sr. Programmer/Analyst        574/631-3550
Institutional Research
210 Flanner Hall
University of Notre Dame
Notre Dame, IN  46556-5611
Reply | Threaded
Open this post in threaded view
|

Re: comments within commands .

Catherine Kubitschek
In reply to this post by Richard Ristow
Many thanks, Richard and Jonathan.  That was exactly the problem and
Richard's solution worked. -Catherine

At 9/24/2007 10:03 PM, Richard Ristow wrote:

>At 09:42 PM 9/24/2007, Catherine Kubitschek wrote:
>
>>I'm trying to comment out part of a command in situ but I'm not having
>>much luck getting it to run.
>>
>>match files file=Acad_013   /in=in013
>>            /table=Acad_Tce  /in=inTce
>>            /*   /table=Acad_2006 /in=in2006 */
>>            /by Id .
>>
>>The error message I'm getting indicates that the comment is ending the
>>match files command.
>
>I'm afraid that's just what happens. As you quote from the Command
>Syntax Reference, "The comment can be placed wherever a blank is
>valid." Unfortunately, as a corollary or implementation quirk, for
>parsing of code, a comment *IS* a blank. So your command is parsed as
>
>match files file=Acad_013   /in=in013
>            /table=Acad_Tce  /in=inTce
>
>            /by Id .
>
>and the blank line ends it. I'd like to do what you want to, too, but
>anyway, this should work (but untested):
>
>match files file=Acad_013   /in=in013
>            /table=Acad_Tce  /in=inTce
>            /*   /table=Acad_2006 /in=in2006 */ /by Id .