Hi, all. Sorry if this is obvious or the answers easy to find but I've been working on this for a couple of days and my Google skills aren't helping.
=====================
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
I'm running 64-bit SPSS 20 on a Windows 7 machine. I've boiled my code down to this:
When I run this code, the first part (pre-define) works just fine. The second part (the macro definition) is just the first part wrapped into a macro and running that selection gives no errors either. When I call the macro, I get an error message (_SLINE OFF.) and the "Information area" at the bottom of the windows say "Waiting for more inline data" and one says "Transformations pending". At that point sometimes I can stop the processing and exit SPSS normally and sometimes I have to use the Windows Task Manager.
The output looks like:
I have three questions that I have been unable to answer for myself and would appreciate any help with. 1. What does "_SLINE OFF." mean? I've run into it before but never understood what it meant. I can't find it in the documentation and the only thing I'm finding with Google is that it has something to do with Python but there's not Python in my code and 'something to do with Python' isn't too helpful anyway. I'm hoping for an explanation that I can use now and in the future when I need to debug my code. This question is the real reason I'm writing the list.
2. What's wrong with my macro code that causes it to bomb? I've put data lists into macros before so that doesn't seem like the answer. The code works outside of the macro. I'm stumped.
3. What I'm trying to do with this code is time sections of my syntax, I'm running many "SPSSINC COMPARE DATASETS" commands and it feels like the code is slowing down. I would like to know if I'm imagining things or if I need to look more closely at my code for inefficiencies. Does anyone know of a better way to either get timestamps or elapsed time scattered throughout the journal file or in some other way let me know how long the dataset comparisons are taking?
Thanks for reading all of this and for any help you can give me. |
That SLINE state is normally transient.
It normally indicates some unclosed block in the syntax. You
can get it from Python or R program blocks, which is why you found a reference
to Python connected with it. In this case, it likely indicates that
your expanded macro is missing some closing statement. Run SET MPRINT
ON before running your macro to see exactly what the macro expansion generated.
===================== 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 |
Thanks, Jon. _SLINE has confused me before so I'm glad to get an explanation I can find next time (and the next time...) Here's what I see with mprint on:
If I change the dash in the data list to an "x" I get
It looks like it is unhappy with my data list and data. I still don't see what I've done wrong but if I move the data list outside the macro it fixes the problem. (BEGIN DATA doesn't need a period does it? The syntax reference says "The command terminator after BEGIN DATA is optional. It is best to leave it out so that the program will treat inline data as one continuous specification." but maybe the rules are a little different inside a macro.)
That's a solution I can live with. On Mon, Aug 11, 2014 at 12:16 PM, Jon K Peck <[hidden email]> wrote: That SLINE state is normally transient. It normally indicates some unclosed block in the syntax. You can get it from Python or R program blocks, which is why you found a reference to Python connected with it. In this case, it likely indicates that your expanded macro is missing some closing statement. Run SET MPRINT ON before running your macro to see exactly what the macro expansion generated. |
If your goal is just to record completion
times, note that the Notes table already includes the elapsed time for
a procedure. That is only the backend time - additional time may
be required in the Viewer that actually displays the output. If you
are summing over multiple commands and want to use PRINT, it can print
$TIME, so you don't need to compute another variable.
Better, you could just run SHOW $VARS, which will include the current time in the small output table. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Catherine Kubitschek <[hidden email]> To: Jon K Peck/Chicago/IBM@IBMUS Cc: [hidden email] Date: 08/11/2014 12:00 PM Subject: Re: [SPSSX-L] _SLINE OFF. Thanks, Jon. _SLINE has confused me before so I'm glad to get an explanation I can find next time (and the next time...) Here's what I see with mprint on: !StartTime . 37 0 M> 38 0 M> . 39 0 M> data list / a 1-100 (a). Data List will read 1 records from the command file Variable Rec Start End Format a 1 1 100 A100 40 0 M> begin data - end data. _SLINE OFF. If I change the dash in the data list to an "x" I get 40 0 M> begin data x end data. _SLINE OFF. It looks like it is unhappy with my data list and data. I still don't see what I've done wrong but if I move the data list outside the macro it fixes the problem. (BEGIN DATA doesn't need a period does it? The syntax reference says "The command terminator after BEGIN DATA is optional. It is best to leave it out so that the program will treat inline data as one continuous specification." but maybe the rules are a little different inside a macro.) DEFINE !StartTime () . compute ThisTime=$time . formats ThisTime (DateTime32) . print /ThisTime . exe . !ENDDEFINE . data list / a 1-100 (a) . begin data x end data . !StartTime . That's a solution I can live with. Catherine On Mon, Aug 11, 2014 at 12:16 PM, Jon K Peck <peck@...> wrote: That SLINE state is normally transient. It normally indicates some unclosed block in the syntax. You can get it from Python or R program blocks, which is why you found a reference to Python connected with it. In this case, it likely indicates that your expanded macro is missing some closing statement. Run SET MPRINT ON before running your macro to see exactly what the macro expansion generated. ===================== 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 |
In reply to this post by Catherine Kubitschek
Command syntax reference clearly states for DEFINE-!ENDDEFINE on
page 609.
"The BEGIN DATA—END DATA commands are not allowed within a macro". This did not worked correctly: DEFINE !StartTime () data list / a 1-100 (a) . begin data - end data . exe . !ENDDEFINE . !StartTime . The value "-" was never input. 11.08.2014 19:10, Catherine Kubitschek
пишет:
===================== 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 and Kirill, Thank you! SHOW $VARS . is exactly what I'm looking for. Missing the first line on page 609 is just embarrassing. I'm glad you found it for me.
I believe that answers all three of my questions. I love this list and its many knowledgeable and helpful people. On Mon, Aug 11, 2014 at 3:46 PM, Kirill Orlov <[hidden email]> wrote:
|
In reply to this post by Catherine Kubitschek
Hi,
You can also do this: Host command = ['echo %time%']. Albert-Jan ------------------------------ On Mon, Aug 11, 2014 5:10 PM CEST Catherine Kubitschek wrote: >Hi, all. Sorry if this is obvious or the answers easy to find but I've been >working on this for a couple of days and my Google skills aren't helping. > >I'm running 64-bit SPSS 20 on a Windows 7 machine. I've boiled my code down >to this: > >data list / >a 1-100 (a) . >begin data >- >end data . >compute ThisTime=$time . >formats ThisTime (DateTime32) . >print /ThisTime . >exe . > > >DEFINE !StartTime () . >data list / >a 1-100 (a) . >begin data >- >end data . >compute ThisTime=$time . >formats ThisTime (DateTime32) . >print /ThisTime . >exe . >!ENDDEFINE . > >!StartTime . > > >When I run this code, the first part (pre-define) works just fine. The >second part (the macro definition) is just the first part wrapped into a >macro and running that selection gives no errors either. When I call the >macro, I get an error message (_SLINE OFF.) and the "Information area" at >the bottom of the windows say "Waiting for more inline data" and one says >"Transformations pending". At that point sometimes I can stop the >processing and exit SPSS normally and sometimes I have to use the Windows >Task Manager. > >The output looks like: > >data list / >a 1-100 (a) . > >Data List will read 1 records from the command file > >Variable Rec Start End Format >a 1 1 100 A100 >begin data >- >end data . >compute ThisTime=$time . >formats ThisTime (DateTime32) . >print /ThisTime . >exe . > 11-AUG-2014 10:55:56 > > >DEFINE !StartTime () . >data list / >a 1-100 (a) . >begin data >- >end data . >compute ThisTime=$time . >formats ThisTime (DateTime32) . >print /ThisTime . >exe . >!ENDDEFINE . > >!StartTime . > >Data List will read 1 records from the command file > >Variable Rec Start End Format >a 1 1 100 A100 >_SLINE OFF. > > >I have three questions that I have been unable to answer for myself and >would appreciate any help with. > >1. What does "_SLINE OFF." mean? I've run into it before but never >understood what it meant. I can't find it in the documentation and the only >thing I'm finding with Google is that it has something to do with Python >but there's not Python in my code and 'something to do with Python' isn't >too helpful anyway. I'm hoping for an explanation that I can use now and in >the future when I need to debug my code. This question is the real reason >I'm writing the list. > >2. What's wrong with my macro code that causes it to bomb? I've put data >lists into macros before so that doesn't seem like the answer. The code >works outside of the macro. I'm stumped. > >3. What I'm trying to do with this code is time sections of my syntax, I'm >running many "SPSSINC COMPARE DATASETS" commands and it feels like the code >is slowing down. I would like to know if I'm imagining things or if I need >to look more closely at my code for inefficiencies. Does anyone know of a >better way to either get timestamps or elapsed time scattered throughout >the journal file or in some other way let me know how long the dataset >comparisons are taking? > >Thanks for reading all of this and for any help you can give me. > >Catherine > >===================== >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 |
Free forum by Nabble | Edit this page |