General Question on Running Syntax Files

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

General Question on Running Syntax Files

Atai Winkler

Hi

 

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

 

Thank you.

 

Atai

 

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

pamanalytics.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: General Question on Running Syntax Files

Jon Peck
Other than breaking up the syntax files into appropriate chunks, there is no way to run a subset other than with a selection.  You can use Run > To end to run from the cursor to the end of the file.  And I expect that you know about using shift-click to select a range of code.  You could use bookmarks to help in making a selection.  See Edit > Syntax Shortcuts.

It would be possible to write a little Python program to run from line number to line number, but you would have to look those up.

On Wed, Jan 27, 2021 at 11:53 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

 

Thank you.

 

Atai

 

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

pamanalytics.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


--
Jon K Peck
[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
Reply | Threaded
Open this post in threaded view
|

Re: General Question on Running Syntax Files

Art Kendall
In reply to this post by Atai Winkler
A lot depends on exactly what you are trying to do and how often you intend
to do it.

Are the segments data definition? Transformations?  Sets of Procedures? For
subsetting cases or variables?

You can put parts of the syntax in different files and use only the parts
needed
go to <help> and search for INCLUDE


for mutually exclusive sets of cases
go to <help> and search for SPLIT

for sets of cases that have overlapping membership search the archives for
"SPSSINC" and "sets"

Do you just want to see the results of one segment befor doing the next?
IIRC in later versions
<run> <step> gives some flexibility.





-----
Art Kendall
Social Research Consultants
--
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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: General Question on Running Syntax Files

spss.giesel@yahoo.de
In reply to this post by Atai Winkler
Hi, Atai,

a) if syntax blocks are immutable it might be as easy as that:

* =============================================================.
DATA LIST /ID 1-3 SEX 5 (A) AGE 7-8 OPINION1 TO OPINION5 10-14.
BEGIN DATA
001 m 28 12212
002 f 29 21212
003 f 45 32145
128 m 17 11194
END DATA.


/* Define syntax chapters */


DEFINE !part1()
LIST SEX age.
LIST OPINION1 OPINION2 OPINION3 OPINION4 OPINION5.
!ENDDEFINE.


DEFINE !part2()
CTABLES /TABLE SEX.
CTABLES /TABLE age[C].
!ENDDEFINE.


DEFINE !part3()
CTABLES /TABLE OPINION1.
CTABLES /TABLE OPINION2.
CTABLES /TABLE OPINION3.
CTABLES /TABLE OPINION4.
CTABLES /TABLE OPINION5.
!ENDDEFINE.


/* Define Call  */


DEFINE !give(!POS !CMDEND) 
!DO !i !IN (!1) !i !DOEND 
!ENDDEFINE.


/* Calls */


!give !part1.
!give !part1 !part2.
!give !part1 !part2 !part3.
* =============================================================.

If anything changes you have to define additional parameters.

b) A second idea might be to write syntax files for each part and call them with an INSERT command.
But that is a little more cumbersome, I guess.

GL,

Mario Giesel
Munich, Germany




Am Mittwoch, 27. Januar 2021, 19:53:02 MEZ hat Atai Winkler <[hidden email]> Folgendes geschrieben:





  


Hi

 

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

 

Thank you.

 

Atai

 

 

 

Dr Atai Winkler

Principal ConsultantPAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

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

Re: SPSSX-L Digest - 26 Jan 2021 to 27 Jan 2021 (#2021-17)

Guterbock, Thomas M (tmg1p)
In reply to this post by Atai Winkler
You could also break up the long syntax file into pieces, each piece saves as and .sps file, then use the Include command in a master syntax file to run all the pieces in sequence, or just the pieces you need at the time.
  HTH,
 Tom Guterbock, UVa

-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of SPSSX-L automatic digest system
Sent: Thursday, January 28, 2021 12:00 AM
To: [hidden email]
Subject: SPSSX-L Digest - 26 Jan 2021 to 27 Jan 2021 (#2021-17)

There are 7 messages totaling 733 lines in this issue.

Topics of the day:

  1. Multiple response crosstabs with weighted data sets in SPSS (3)
  2. General Question on Running Syntax Files (4)

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

----------------------------------------------------------------------

Date:    Wed, 27 Jan 2021 17:38:39 +0200
From:    Mark Webb <[hidden email]>
Subject: Multiple response crosstabs with weighted data sets in SPSS

Is this possible?
It runs, makes the xtab but it's always unweighted.
Why is this? What am I missing?

Regards

Mark Webb

WhatsApp +27 (72) 199 1000 [Good Reception] Cell +27 (72) 199 1000 [Poor Reception] Fax to email +27 (86) 5513075 Skype  tomarkwebb Email  [hidden email] No landline

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

------------------------------

Date:    Wed, 27 Jan 2021 18:17:25 +0000
From:    "[hidden email]" <[hidden email]>
Subject: Re: Multiple response crosstabs with weighted data sets in SPSS

Hi,

some syntax would help.

Mario Giesel
Munich, germany




Am Mittwoch, 27. Januar 2021, 16:38:52 MEZ hat Mark Webb <[hidden email]> Folgendes geschrieben:





Is this possible?
It runs, makes the xtab but it's always unweighted.
Why is this? What am I missing?

Regards

Mark Webb

WhatsApp +27 (72) 199 1000 [Good Reception] Cell +27 (72) 199 1000 [Poor Reception] Fax to email +27 (86) 5513075 Skype  tomarkwebb Email  [hidden email] No landline ===================== 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

------------------------------

Date:    Wed, 27 Jan 2021 11:38:36 -0700
From:    Jon Peck <[hidden email]>
Subject: Re: Multiple response crosstabs with weighted data sets in SPSS

The MULT RESPONSE command, if that is the one you are using, does  honor the weight.  The CTABLES equivalent also honors weight, but it gives you the option of using effective base weighting instead.

On Wed, Jan 27, 2021 at 8:38 AM Mark Webb <[hidden email]> wrote:

> Is this possible?
> It runs, makes the xtab but it's always unweighted.
> Why is this? What am I missing?
>
> Regards
>
> Mark Webb
>
> WhatsApp +27 (72) 199 1000 [Good Reception] Cell +27 (72) 199 1000
> [Poor Reception] Fax to email +27 (86) 5513075 Skype  tomarkwebb Email  
> [hidden email] No landline ===================== 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



--
Jon K Peck
[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

------------------------------

Date:    Wed, 27 Jan 2021 18:52:56 +0000
From:    Atai Winkler <[hidden email]>
Subject: General Question on Running Syntax Files

Hi

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

Thank you.

Atai



Dr Atai Winkler
Principal Consultant
PAM Analytics

[hidden email]<mailto:[hidden email]>
Skype: ataiwinkler

pamanalytics.com<http://www.pamanalytics.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

------------------------------

Date:    Wed, 27 Jan 2021 12:01:18 -0700
From:    Jon Peck <[hidden email]>
Subject: Re: General Question on Running Syntax Files

Other than breaking up the syntax files into appropriate chunks, there is no way to run a subset other than with a selection.  You can use Run > To end to run from the cursor to the end of the file.  And I expect that you know about using shift-click to select a range of code.  You could use bookmarks to help in making a selection.  See Edit > Syntax Shortcuts.

It would be possible to write a little Python program to run from line number to line number, but you would have to look those up.

On Wed, Jan 27, 2021 at 11:53 AM Atai Winkler <[hidden email]>
wrote:

> Hi
>
>
>
> I have a number of very long programs (> 1,000 lines) and quite often
> I only want to run parts of the programs (from line number *i* to line
> number *j*). Currently I run parts of programs by highlighting them
> and then selecting the green right facing arrow. Is there a simple way
> if running parts of programs either by using a dialogue box or by
> writing a simple program or macro?
>
>
>
> Thank you.
>
>
>
> Atai
>
>
>
>
>
>
>
> Dr Atai Winkler
>
> Principal Consultant
> PAM Analytics
>
>
>
> [hidden email]
>
> Skype: ataiwinkler
>
>
>
> pamanalytics.com <http://www.pamanalytics.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



--
Jon K Peck
[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

------------------------------

Date:    Wed, 27 Jan 2021 12:22:06 -0700
From:    Art Kendall <[hidden email]>
Subject: Re: General Question on Running Syntax Files

A lot depends on exactly what you are trying to do and how often you intend to do it.

Are the segments data definition? Transformations?  Sets of Procedures? For subsetting cases or variables?

You can put parts of the syntax in different files and use only the parts needed go to <help> and search for INCLUDE


for mutually exclusive sets of cases
go to <help> and search for SPLIT

for sets of cases that have overlapping membership search the archives for "SPSSINC" and "sets"

Do you just want to see the results of one segment befor doing the next?
IIRC in later versions
<run> <step> gives some flexibility.





-----
Art Kendall
Social Research Consultants
--
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

------------------------------

Date:    Wed, 27 Jan 2021 20:34:30 +0000
From:    "[hidden email]" <[hidden email]>
Subject: Re: General Question on Running Syntax Files

Hi, Atai,

a) if syntax blocks are immutable it might be as easy as that:

* =============================================================.
DATA LIST /ID 1-3 SEX 5 (A) AGE 7-8 OPINION1 TO OPINION5 10-14.
BEGIN DATA
001 m 28 12212
002 f 29 21212
003 f 45 32145
128 m 17 11194
END DATA.


/* Define syntax chapters */


DEFINE !part1()
LIST SEX age.
LIST OPINION1 OPINION2 OPINION3 OPINION4 OPINION5.
!ENDDEFINE.


DEFINE !part2()
CTABLES /TABLE SEX.
CTABLES /TABLE age[C].
!ENDDEFINE.


DEFINE !part3()
CTABLES /TABLE OPINION1.
CTABLES /TABLE OPINION2.
CTABLES /TABLE OPINION3.
CTABLES /TABLE OPINION4.
CTABLES /TABLE OPINION5.
!ENDDEFINE.


/* Define Call  */


DEFINE !give(!POS !CMDEND) 
!DO !i !IN (!1) !i !DOEND 
!ENDDEFINE.


/* Calls */


!give !part1.
!give !part1 !part2.
!give !part1 !part2 !part3.
* =============================================================.

If anything changes you have to define additional parameters.

b) A second idea might be to write syntax files for each part and call them with an INSERT command.
But that is a little more cumbersome, I guess.

GL,

Mario Giesel
Munich, Germany




Am Mittwoch, 27. Januar 2021, 19:53:02 MEZ hat Atai Winkler <[hidden email]> Folgendes geschrieben:





  


Hi

 

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

 

Thank you.

 

Atai

 

 

 

Dr Atai Winkler

Principal ConsultantPAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

pamanalytics.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

------------------------------

End of SPSSX-L Digest - 26 Jan 2021 to 27 Jan 2021 (#2021-17)
*************************************************************

=====================
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: General Question on Running Syntax Files

Atai Winkler
In reply to this post by Jon Peck

Hi

 

Thank you for all your replies.

 

Kind regards

 

Atai

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

pamanalytics.com

 

 

 

 

 

 

From: Jon Peck <[hidden email]>
Sent: 27 January 2021 19:01
To: Atai Winkler <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] General Question on Running Syntax Files

 

Other than breaking up the syntax files into appropriate chunks, there is no way to run a subset other than with a selection.  You can use Run > To end to run from the cursor to the end of the file.  And I expect that you know about using shift-click to select a range of code.  You could use bookmarks to help in making a selection.  See Edit > Syntax Shortcuts.

 

It would be possible to write a little Python program to run from line number to line number, but you would have to look those up.

 

On Wed, Jan 27, 2021 at 11:53 AM Atai Winkler <[hidden email]> wrote:

Hi

 

I have a number of very long programs (> 1,000 lines) and quite often I only want to run parts of the programs (from line number i to line number j). Currently I run parts of programs by highlighting them and then selecting the green right facing arrow. Is there a simple way if running parts of programs either by using a dialogue box or by writing a simple program or macro?

 

Thank you.

 

Atai

 

 

 

Dr Atai Winkler

Principal Consultant
PAM Analytics

 

[hidden email]

Skype: ataiwinkler

 

pamanalytics.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


 

--

Jon K Peck
[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