+ at beginning of syntax line

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

+ at beginning of syntax line

J McClure
Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at
http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

=====================
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: + at beginning of syntax line

Bruce Weaver
Administrator
J McClure wrote
Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at
http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan
This is covered in the Command Syntax Reference manual.  The following is from p. 37 in the v18 manual.

--- start of excerpt from CSR manual ---

Batch (Production) Mode

The following rules apply to command specifications in batch mode:

* All commands in the command file must begin in column 1. You can use plus (+) or minus (–) signs in the first column if you want to indent the command specification to make the command file more readable.
* If multiple lines are used for a command, column 1 of each continuation line must be blank.
* Command terminators are optional.
* A line cannot exceed 256 bytes; any additional characters are truncated.

The following is a sample command file that will run in either interactive or batch mode:

GET FILE=/MYFILES/BANK.SAV'
/KEEP ID TIME SEX JOBCAT SALBEG SALNOW
/RENAME SALNOW = SAL90.
DO IF TIME LT 82.
+ COMPUTE RATE=0.05.
ELSE.
+ COMPUTE RATE=0.04.
END IF.
COMPUTE SALNOW=(1+RATE)*SAL90.
EXAMINE VARIABLES=SALNOW BY SEX.

--- end of excerpt from CSR manual ---

HTH.
--
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: + at beginning of syntax line

John F Hall
In reply to this post by J McClure
Jan
 
If you worked with syntax from the beginning, and didn't try to run before you can even crawl, you would have picked up already that the + indicates a continuation line. 
 
Like I said, "More haste, less speed."
 
John
----- Original Message -----
Sent: Monday, September 06, 2010 7:26 PM
Subject: + at beginning of syntax line


Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at
http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

=====================
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: + at beginning of syntax line

Gary Oliver-3
John
 
I think you were unreasonably tough with your comment to Jan who not only answered the question for themself but found a reference and posted it for the benefit of the rest of us
 
Warm regards/gary


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Tuesday, September 07, 2010 4:42 AM
To: [hidden email]
Subject: Re: + at beginning of syntax line

Jan
 
If you worked with syntax from the beginning, and didn't try to run before you can even crawl, you would have picked up already that the + indicates a continuation line. 
 
Like I said, "More haste, less speed."
 
John
----- Original Message -----
Sent: Monday, September 06, 2010 7:26 PM
Subject: + at beginning of syntax line


Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at
http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

=====================
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: + at beginning of syntax line

Jon K Peck

I would also like to point out that batch-style syntax is never necessary in any reasonably recent version of SPSS.  Although the INCLUDE command requires it, INCLUDE is obsolete, superseded by INSERT in version 13.  Syntax pasted by the dialogs always complies with the interactive rules (and is an excellent way to start learning syntax).  Batch rules are just a legacy still supported for compatibility.

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



From: Gary Oliver <[hidden email]>
To: [hidden email]
Date: 09/07/2010 07:41 AM
Subject: Re: [SPSSX-L] + at beginning of  syntax line
Sent by: "SPSSX(r) Discussion" <[hidden email]>





John
 
I think you were unreasonably tough with your comment to Jan who not only answered the question for themself but found a reference and posted it for the benefit of the rest of us
 
Warm regards/gary


From: SPSSX(r) Discussion [[hidden email]] On Behalf Of John F Hall
Sent:
Tuesday, September 07, 2010 4:42 AM
To:
[hidden email]
Subject:
Re: + at beginning of syntax line


Jan
 
If you worked with syntax from the beginning, and didn't try to run before you can even crawl, you would have picked up already that the + indicates a continuation line.  
 
Like I said, "More haste, less speed."
 
John
----- Original Message -----
From: J McClure
To: [hidden email]
Sent: Monday, September 06, 2010 7:26 PM
Subject: + at beginning of syntax line


Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at

http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

=====================
To manage your subscription to SPSSX-L, send a message to

LISTSERV@... (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: + at beginning of syntax line

statisticsdoc
In reply to this post by Gary Oliver-3
I must concur with Gary.
Steve

www.StatisticsDoc.com


From: Gary Oliver <[hidden email]>
Sender: "SPSSX(r) Discussion" <[hidden email]>
Date: Tue, 7 Sep 2010 08:43:46 +1000
ReplyTo: Gary Oliver <[hidden email]>
Subject: Re: + at beginning of syntax line

John
 
I think you were unreasonably tough with your comment to Jan who not only answered the question for themself but found a reference and posted it for the benefit of the rest of us
 
Warm regards/gary


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Tuesday, September 07, 2010 4:42 AM
To: [hidden email]
Subject: Re: + at beginning of syntax line

Jan
 
If you worked with syntax from the beginning, and didn't try to run before you can even crawl, you would have picked up already that the + indicates a continuation line. 
 
Like I said, "More haste, less speed."
 
John
----- Original Message -----
Sent: Monday, September 06, 2010 7:26 PM
Subject: + at beginning of syntax line


Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at
http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

=====================
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: + at beginning of syntax line

J McClure
In reply to this post by Jon K Peck
Thanks for the info Jon, you are a fount of knowledge. (I hope your bosses appreciate you!)
I assumed that because the '+' was in the Command Guide examples in multiple places that it was necessary but when I removed the '+' signs the syntax ran just fine.
I've used paste to see the syntax but hadn't thought of using it in this way.
Jan

On 9/7/2010 6:56 AM, Jon K Peck wrote:

I would also like to point out that batch-style syntax is never necessary in any reasonably recent version of SPSS.  Although the INCLUDE command requires it, INCLUDE is obsolete, superseded by INSERT in version 13.  Syntax pasted by the dialogs always complies with the interactive rules (and is an excellent way to start learning syntax).  Batch rules are just a legacy still supported for compatibility.

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



From: Gary Oliver [hidden email]
To: [hidden email]
Date: 09/07/2010 07:41 AM
Subject: Re: [SPSSX-L] + at beginning of  syntax line
Sent by: "SPSSX(r) Discussion" [hidden email]





John
 
I think you were unreasonably tough with your comment to Jan who not only answered the question for themself but found a reference and posted it for the benefit of the rest of us
 
Warm regards/gary


From: SPSSX(r) Discussion [[hidden email]] On Behalf Of John F Hall
Sent:
Tuesday, September 07, 2010 4:42 AM
To:
[hidden email]
Subject:
Re: + at beginning of syntax line


Jan
 
If you worked with syntax from the beginning, and didn't try to run before you can even crawl, you would have picked up already that the + indicates a continuation line.  
 
Like I said, "More haste, less speed."
 
John
----- Original Message -----
From: [hidden email]
To: [hidden email]
Sent: Monday, September 06, 2010 7:26 PM
Subject: + at beginning of syntax line


Hi,
I don't know who to direct this to but I was mystified by the '+' sign
at the beginning of the line for certain syntax (loops, do if etc) and
I'd like to suggest that the purpose be added to the Command Syntax
Reference Guide. I searched the Guide several times (very tedious
because there are many, many + signs in the document) and gave up after
awhile. I searched the internet a number of times and found only
examples but no explanations. I asked my husband who knows a dozen
computer languages and he didn't know the purpose. I finally did a
slightly different search and found the answer in an online tutorial at

http://www.stat-help.com/spss.pdf.
Thanks for all the help provided on this site! It's been immensely
valuable.
Jan

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