how many cases

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

Re: how many cases

Art Kendall
PRINT has long been used in debugging. for example, ending a do if block when it reached ELSE.
Each DO IF block would put messages in the listing.
something like this untested example

do if condition1.
compute newvar=1.
else if condition2.
compute newvar=2.
else.
compute newvar=-1.
print /' problem in setting newvar' ' ID= ' ID 'Age = ' Age /.
end if.
do if gender eq 'male' and not missing(pregnancy#).
print //'ID = ' ID gender 'recorded as being pregnant' pregnancy# ' times/.
compute pregnancy#  = -1.
end if.

 


Art Kendall
Social Research Consultants
On 5/7/2014 8:52 PM, Rich Ulrich [via SPSSX Discussion] wrote:
PRINT does not cause a data-pass to occur, and that is why EXE is needed.

I think of it as setting a flag.  Thus, if you have several PRINTs , they will be
run in the same reading of the file -- their results will be intermixed -- and
not in separate passes. 

--
Rich Ulrich

> Date: Wed, 7 May 2014 20:14:41 +0200

> From: [hidden email]
> Subject: Re: how many cases
> To: [hidden email]
>
> On 2014-05-06 10:18 David Marso <[hidden email]> wrote:
> > DO IF (v46c = 5).
> > PRINT / v46s.
> > END IF.
> > EXECUTE.
>
> It is a nice workaround and I can live with it.
>
> The output is ugly. ;)
>
> And I don't understand the concept behind it. Why is PRINT a
> transformation command (execute is needed). It displays values.
> --
...



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/how-many-cases-tp5725823p5725897.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: how many cases

Art Kendall
In reply to this post by Rich Ulrich
PRINT has long been used in debugging. for example, ending a do if block when it reached ELSE.
Each DO IF block would put messages in the listing.
something like this untested example

do if condition1.
compute newvar=1.
else if condition2.
compute newvar=2.
else.
compute newvar=-1.
print /' problem in setting newvar' ' ID= ' ID 'Age = ' Age /.
end if.
do if gender eq 'male' and not missing(pregnancy#).
print //'ID = ' ID gender 'recorded as being pregnant' pregnancy# ' times/.
compute pregnancy

Art Kendall
Social Research Consultants
On 5/7/2014 8:52 PM, Rich Ulrich [via SPSSX Discussion] wrote:
PRINT does not cause a data-pass to occur, and that is why EXE is needed.

I think of it as setting a flag.  Thus, if you have several PRINTs , they will be
run in the same reading of the file -- their results will be intermixed -- and
not in separate passes. 

--
Rich Ulrich

> Date: Wed, 7 May 2014 20:14:41 +0200

> From: [hidden email]
> Subject: Re: how many cases
> To: [hidden email]
>
> On 2014-05-06 10:18 David Marso <[hidden email]> wrote:
> > DO IF (v46c = 5).
> > PRINT / v46s.
> > END IF.
> > EXECUTE.
>
> It is a nice workaround and I can live with it.
>
> The output is ugly. ;)
>
> And I don't understand the concept behind it. Why is PRINT a
> transformation command (execute is needed). It displays values.
> --
...



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/how-many-cases-tp5725823p5725897.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
12