How to close the working dataset?

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

Re: How to close the working dataset?

Art Kendall
maybe a new dataset command.

DATASET KEEP OPEN active name1 name2 ...



-----
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: How to close the working dataset?

Jon Peck
In reply to this post by PRogman
It would be pretty easy to make an enhanced DATASET CLOSE extension command, say, STATS DATASET CLOSE that provided more options, but tweaking the existing command would make more sense if this is a real issue.  I haven't heard this raised since the command was introduced in V22,  and I would like to hear some real use cases.

On Sat, Dec 9, 2017 at 5:27 AM, PRogman <[hidden email]> wrote:
Ok for P-th-n stuff, but it can not be used inside DEFINE-!ENDDEFINE so it
won't work in macros without fully making it an extension command?
/PR


Jon Peck wrote
> Since V22, the DATASET DISPLAY output has included  the creation time
> stamp
> and the associated filespec, if any, for each dataset.  However, it does
> not keep an activation history.  Activating a different DE window will
> change the backend active dataset to match but dialog boxes paste the
> appropriate dataset activate command to go with their dataset.
>
> One could, of course, manage all this with that P--- stuff.
>
> On Fri, Dec 8, 2017 at 5:16 PM, PRogman &lt;

> peder@

> &gt; wrote:
>
>> There is something strange happening when active dataset is closed. See
>> variables below in the syntax example. A closed dataset does not
>> disapperar
>> until a new is declared active, so the natural way would be to activate a
>> designated active dataset and then delete the previous. Here the problem
>> appears if you do not know the name of the dataset to activate.
>> It would be helpful to Preserve/PUSH and Restore/POP or otherwise store
>> and
>> recall the dataset name.
>> /PR
>>
>>
>> NEW FILE.
>> DATASET CLOSE ALL.
>>
>> DATA LIST LIST / junk(F1).
>> BEGIN DATA
>> 1
>> END DATA.
>> DATASET NAME     X.
>> LIST junk.
>> DATASET DISPLAY.
>>
>> DATA LIST LIST / morejunk(F1).
>> BEGIN DATA
>> 2
>> END DATA.
>> DATASET NAME     Y.
>> LIST morejunk.
>> DATASET DISPLAY.
>>
>> DATASET CLOSE    Y.
>> COMPUTE morejunk = morejunk * 100.
>> LIST    morejunk.
>> DATASET DISPLAY.
>>
>> COMPUTE junk = junk * 10.
>> LIST    junk.
>> DATASET DISPLAY.
>>
>> DATASET ACTIVATE X.
>> DATASET DISPLAY.
>> LIST junk.
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

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

> jkpeck@

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

> LISTSERV@.UGA

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





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



--
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: How to close the working dataset?

PRogman
I have usually solved the problem by having the name of the active dataset as
a parameter in a macro that uses different datasets for data manipulation,
tables and graphs. The key point is what Kirill sought was how to return to
the calling active dataset /without knowing its name /and not changing it to
something specific name. In the example below the parameter ds would not be
needed, and it is the final DATASET ACTIVATE that removes the closed MyDS
(unless closing is done after activating !ds).
/PR

DEFINE MyMacro( !POS !TOKENS(1) /!POS !TOKENS(1) /ds !TOKENS(1) )

*wish: PRESERVE ACTIVEDATASET.
DATASET COPY MyDS.
DATASET ACTIVATE MyDS WINDOWS=ASIS.
...
manipulate...maybe:
MATCH FILES FILE=* /KEEP !1 !2.
...
DATASET CLOSE MyDS.
*wish: RESTORE ACTIVEDATASET., instead...
DATASET ACTIVATE !ds WINDOW=ASIS.
!ENDDEFINE.






 
Jon Peck wrote
> It would be pretty easy to make an enhanced DATASET CLOSE extension
> command, say, STATS DATASET CLOSE that provided more options, but tweaking
> the existing command would make more sense if this is a real issue.  I
> haven't heard this raised since the command was introduced in V22,  and I
> would like to hear some real use cases.
>
> On Sat, Dec 9, 2017 at 5:27 AM, PRogman &lt;

> peder@

> &gt; wrote:
>
>> Ok for P-th-n stuff, but it can not be used inside DEFINE-!ENDDEFINE so
>> it
>> won't work in macros without fully making it an extension command?
>> /PR
>>
>>
>> Jon Peck wrote
>> > Since V22, the DATASET DISPLAY output has included  the creation time
>> > stamp
>> > and the associated filespec, if any, for each dataset.  However, it
>> does
>> > not keep an activation history.  Activating a different DE window will
>> > change the backend active dataset to match but dialog boxes paste the
>> > appropriate dataset activate command to go with their dataset.
>> >
>> > One could, of course, manage all this with that P--- stuff.
>> >
>> > On Fri, Dec 8, 2017 at 5:16 PM, PRogman &lt;
>>
>> > peder@
>>
>> > &gt; wrote:
>> >
>> >> There is something strange happening when active dataset is closed.
>> See
>> >> variables below in the syntax example. A closed dataset does not
>> >> disapperar
>> >> until a new is declared active, so the natural way would be to
>> activate
>> a
>> >> designated active dataset and then delete the previous. Here the
>> problem
>> >> appears if you do not know the name of the dataset to activate.
>> >> It would be helpful to Preserve/PUSH and Restore/POP or otherwise
>> store
>> >> and
>> >> recall the dataset name.
>> >> /PR
>> >>
>> >>
>> >> NEW FILE.
>> >> DATASET CLOSE ALL.
>> >>
>> >> DATA LIST LIST / junk(F1).
>> >> BEGIN DATA
>> >> 1
>> >> END DATA.
>> >> DATASET NAME     X.
>> >> LIST junk.
>> >> DATASET DISPLAY.
>> >>
>> >> DATA LIST LIST / morejunk(F1).
>> >> BEGIN DATA
>> >> 2
>> >> END DATA.
>> >> DATASET NAME     Y.
>> >> LIST morejunk.
>> >> DATASET DISPLAY.
>> >>
>> >> DATASET CLOSE    Y.
>> >> COMPUTE morejunk = morejunk * 100.
>> >> LIST    morejunk.
>> >> DATASET DISPLAY.
>> >>
>> >> COMPUTE junk = junk * 10.
>> >> LIST    junk.
>> >> DATASET DISPLAY.
>> >>
>> >> DATASET ACTIVATE X.
>> >> DATASET DISPLAY.
>> >> LIST junk.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> >>
>> >> =====================
>> >> To manage your subscription to SPSSX-L, send a message to
>> >>
>>
>> > LISTSERV@.UGA
>>
>> >  (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
>>
>> > jkpeck@
>>
>> >
>> > =====================
>> > To manage your subscription to SPSSX-L, send a message to
>>
>> > LISTSERV@.UGA
>>
>> >  (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
>>
>>
>>
>>
>>
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

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

> jkpeck@

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

> LISTSERV@.UGA

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





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

Re: How to close the working dataset?

Kirill Orlov
In reply to this post by Jon Peck
Jon, please pay attention to my suggestion above: SPSS could indeed design new options (RECENT) and (OLDEST) in DATASET ACTIVATE syntax command. It would be better than to change the behaviour of DATASET CLOSE syntax command which has settled since vers. 15 and is satisfactory, it shouldn't be touched, of course.


09.12.2017 17:39, Jon Peck пишет:
It would be pretty easy to make an enhanced DATASET CLOSE extension command, say, STATS DATASET CLOSE that provided more options, but tweaking the existing command would make more sense if this is a real issue.  I haven't heard this raised since the command was introduced in V22,  and I would like to hear some real use cases.


===================== 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: How to close the working dataset?

Jon Peck
I don't control the designs for built-in features, but if I were designing this, I would add optional keywords or subcommands to the existing commands rather than making new ones.

On Sat, Dec 9, 2017 at 10:50 AM, Kirill Orlov <[hidden email]> wrote:
Jon, please pay attention to my suggestion above: SPSS could indeed design new options (RECENT) and (OLDEST) in DATASET ACTIVATE syntax command. It would be better than to change the behaviour of DATASET CLOSE syntax command which has settled since vers. 15 and is satisfactory, it shouldn't be touched, of course.


09.12.2017 17:39, Jon Peck пишет:
It would be pretty easy to make an enhanced DATASET CLOSE extension command, say, STATS DATASET CLOSE that provided more options, but tweaking the existing command would make more sense if this is a real issue.  I haven't heard this raised since the command was introduced in V22,  and I would like to hear some real use cases.





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