Commenting Syntax

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

Commenting Syntax

Granaas, Michael
I seem to have forgotten how to incorporate comments in my syntax files.  I would really appreciate a reminder.

TIA,

Michael

****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

John F Hall
comment  <text>.
----- Original Message -----
Sent: Thursday, April 01, 2010 9:14 PM
Subject: Commenting Syntax


I seem to have forgotten how to incorporate comments in my syntax files.  I would really appreciate a reminder.

TIA,

Michael

****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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

Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

statisticsdoc
In reply to this post by Granaas, Michael
Make a comment by preceding it with an asterisk.

Steve
------Original Message------
From: Granaas, Michael
Sender: SPSSX(r) Discussion
To: [hidden email]
ReplyTo: Granaas, Michael
Subject: Commenting Syntax
Sent: Apr 1, 2010 3:14 PM

I seem to have forgotten how to incorporate comments in my syntax files.  I would really appreciate a reminder.

TIA,

Michael

****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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


www.StatisticsDoc.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
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

statisticsdoc
In reply to this post by Granaas, Michael
.... And ending it with a period like this


*  comment.   .


Steve
------Original Message------
From: Granaas, Michael
Sender: SPSSX(r) Discussion
To: [hidden email]
ReplyTo: Granaas, Michael
Subject: Commenting Syntax
Sent: Apr 1, 2010 3:14 PM

I seem to have forgotten how to incorporate comments in my syntax files.  I would really appreciate a reminder.

TIA,

Michael

****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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


www.StatisticsDoc.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
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

Jeromy Anglim
In reply to this post by Granaas, Michael
I wrote a page of tips on using SPSS Syntax (e.g., arranging syntax
files, debugging, commenting, links to further resources, etc.)

http://jeromyanglim.blogspot.com/2009/10/introduction-to-spss-syntax-advice-for.html


cheers,
Jeromy


....................................................
I seem to have forgotten how to incorporate comments in my syntax
files.  I would really appreciate a reminder.


TIA,


Michael


****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

Richard Ristow
In reply to this post by Granaas, Michael
At 03:14 PM 4/1/2010, Granaas, Michael wrote:

I seem to have forgotten how to incorporate comments in my syntax files.  I would really appreciate a reminder.

There are two kinds of comment:

Comment statements (as other responders have said) begin with keywords "COMMENT" or "*"; and, like other statements, end with a period (".")(1)

Comments within commands: any text beginning "/*" and ending either with "*/" or with the end of the physical line. Somewhat illogically, this appears to be documented only in article "COMMENT" in the Command Syntax Reference. Careful! SPSS effectively replaces these comments by blanks when it parses commands. That means a line with only such comments is a 'blank' line, and will terminate the command.

There are plenty of different styles in using these comment forms. Here's some of how I often do it:

*  ...........   Solution using VECTOR/LOOP          ............... .
DATASET ACTIVATE TestData WINDOW=FRONT.
DATASET COPY     LOOPing.
DATASET ACTIVATE LOOPing  WINDOW=FRONT.

vector  months=month1 to month40.
VECTOR  SpLen (10,F2)
        SpStrt(10,F2).

NUMERIC #SpellNum(F2) /* Index # of spells within client    */
        #InSpell (F2) /* Flag: a 'spell' is running         */ .

---------------------------------------------
(1) As always, subject to the syntactic differences between what defines a statement in interactive mode and what defines one in batch mode. See "Running Commands" in article "Universals", section "Commands" in the Command Syntax Reference.
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

Bruce Weaver
Administrator
I don't have SPSS on this machine, but IIRC, one can also begin a comment with "/*" and end with a period.  E.g.,

/* This is a comment .

This style of comment is handy if one is going to mention the name of a macro in the comment.

* Now call macro !MyMacro .
/* Now call macro !MyMacro .

In the first example, the macro will try to execute.  In the second example, it won't.


Richard Ristow wrote

At 03:14 PM 4/1/2010, Granaas, Michael wrote:
I seem to have forgotten how to
incorporate comments in my syntax files.  I would really appreciate
a reminder.
There are two kinds of comment:
Comment statements (as other responders have said) begin with
keywords "COMMENT" or
"*"; and, like other statements,
end with a period
(".")(1)
Comments within commands: any text beginning
"/*" and ending either with
"*/" or with the end of the
physical line. Somewhat illogically, this appears to be documented
only in article "COMMENT" in the Command Syntax
Reference. Careful! SPSS effectively replaces these comments by
blanks when it parses commands. That means a line with only such
comments is a 'blank' line, and will terminate the command.
There are plenty of different styles in using these comment forms. Here's
some of how I often do it:
*  ...........   Solution using
VECTOR/LOOP         
............... .
DATASET ACTIVATE TestData WINDOW=FRONT.
DATASET COPY     LOOPing.
DATASET ACTIVATE LOOPing  WINDOW=FRONT.
vector  months=month1 to month40.
VECTOR  SpLen (10,F2)
        SpStrt(10,F2).
NUMERIC #SpellNum(F2) /* Index # of spells within
client    */
        #InSpell (F2) /* Flag: a
'spell' is running         */
.
---------------------------------------------
(1) As always, subject to the syntactic
differences between what defines a statement in interactive mode
and what defines one in batch mode. See
"Running
Commands" in article "Universals", section
"Commands" in the Command Syntax Reference.



=====================
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/).
Reply | Threaded
Open this post in threaded view
|

Re: Commenting Syntax

John F Hall
In reply to this post by Jeromy Anglim
Ok if you're a Chelsea fan: they won 2-1.  Terry Blom (my website man) is the soccer fan, I'm more for rugby myself, but if anything I would support Man City.
 
The SPSS list is inhabited mainly by statistics, but we really need a survey research site to include teaching survey analysis.  I caused a bit of a rumpus last year by accusing SPSS/PASW of being the tail that tried to wag the dog, but there was a small group appealing to keep 15 as universities  can't afford the fees or, more importatant, the institutional cost of constant updates to documentation and tutorials.
 
John
----- Original Message -----
Sent: Sunday, April 04, 2010 12:44 PM
Subject: RE: Re: Commenting Syntax

Hi John,

 

I hope the match went well.

I gave the list a go.

I also had a read through some of your materials on SPSS syntax and added a couple of links to your pages.

http://jeromyanglim.blogspot.com/2009/10/introduction-to-spss-syntax-advice-for.html

 

Thanks for the welcome into the world of the SPSS listserv :-)

 

cheers,

Jeromy

 

Jeromy Anglim


Lecturer, Psychological Sciences, The University of Melbourne

Office: Room 1110 Redmond Barry Building

Email: [hidden email]

Phone: (+613) 834 46355

Website & Blog: http://jeromyanglim.blogspot.com


 

From: John F Hall [mailto:[hidden email]]
Sent: Saturday, 3 April 2010 9:57 PM
To: Jeromy Kyram Anglim
Cc: Bruce Weaver; [hidden email]; GarcĂ­a-Granero; Mike Palij
Subject: Re: Re: Commenting Syntax

 

Looks a good blog.  Will read thoroughly later as Man U vs Chelsea on soon.  I'll put the link on my site and forward it to other spss-ers.  Perhaps you should post it and the other blogs to the full list?

----- Original Message -----

Sent: Saturday, April 03, 2010 10:01 AM

Subject: Re: Commenting Syntax

 


I wrote a page of tips on using SPSS Syntax (e.g., arranging syntax
files, debugging, commenting, links to further resources, etc.)

http://jeromyanglim.blogspot.com/2009/10/introduction-to-spss-syntax-advice-for.html


cheers,
Jeromy


....................................................
I seem to have forgotten how to incorporate comments in my syntax
files.  I would really appreciate a reminder.


TIA,


Michael


****************************************************
Michael Granaas             [hidden email]
Assoc. Prof.                Phone: 605 677 5295
Dept. of Psychology         FAX:  605 677 3195
University of South Dakota
414 E. Clark St.
Vermillion, SD 57069
*****************************************************

=====================
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

Reply | Threaded
Open this post in threaded view
|

SPSS / R version compatability

Christopher Stride
In reply to this post by Bruce Weaver
Hi
Looking to run a generalised linear mixed model - something not
available in SPSS - so using R. Would like to imbed my R code in SPSS
syntax for convenience....

However; the R command I wish to use is lmer, which comes as part of the
R package lme4, the documentation of which specifies R v2.9.0 or above
as a requirement

But - my version of SPSS v18 came bundled with R2.8.1... ;-(

If I upgrade my version of R, will the 'link up' with SPSS (i.e. the
functionaliuty of BEING PROGRAM / END PROGRAM) stop working? Any ideas?
If it's definitely not a goer I don't want to waste a morning adding and
removing versions of R from my PC.

Any help/advice appreciated.

cheers
Chris

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: SPSS / R version compatibility

Jon K Peck

You can have multiple versions of R installed on the same system - I have three versions installed, but SPSS Statistics will continue to use R 2.8.  It might be worth trying with 2.8, though.  lme4 and lmer do exist for 2.8.

HTH,

Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Dr C B Stride <[hidden email]>
To: [hidden email]
Date: 06/10/2010 04:13 AM
Subject: [SPSSX-L] SPSS / R version compatability
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Hi
Looking to run a generalised linear mixed model - something not
available in SPSS - so using R. Would like to imbed my R code in SPSS
syntax for convenience....

However; the R command I wish to use is lmer, which comes as part of the
R package lme4, the documentation of which specifies R v2.9.0 or above
as a requirement

But - my version of SPSS v18 came bundled with R2.8.1... ;-(

If I upgrade my version of R, will the 'link up' with SPSS (i.e. the
functionaliuty of BEING PROGRAM / END PROGRAM) stop working? Any ideas?
If it's definitely not a goer I don't want to waste a morning adding and
removing versions of R from my PC.

Any help/advice appreciated.

cheers
Chris

=====================
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