Thanks and i am sorry for my english not very well
Hi
1) to calculate the number of unique values, use
AGGREGATE OUTFILE=*
/BREAK=yourvar
/cnt=N.
where yourvar is the name of your variable.
2) you then add that value to every case of your data base using the
ADD command.
3) You then use syntax to automatically write a small syntax file
containing only
SCRIPT 'path\name.SBS' ('###').
where ### is replaced by the number obtained. in 1). For an example
of how to write a syntax file using syntax, see
"include 2 output in syntax.sps" in
http://pages.infinit.net/rlevesqu/Macros.htm#SelfAdjustingMacros
4) you then use the INCLUDE command to read the syntax file created in
3).
HTH
Raynald Levesque rlev...@videotron.ca
Visit My SPSS Pages: http://pages.infinit.net/rlevesqu/index.htm
> ... i need a function, that counts number of values (unique)
> of variable between cases? I have not found one in SPSS syntax... nor
> in SAX Basic... How i can do this?
If I understand your problem correct you could
use RANK with /TIES=CONDENSE and pick the highest
value with AGGREGATE (or see below for an alternative)
RANK var00001 (A) /RANK /TIES=CONDENSE.
XSAVE OUTFILE='C:tmpres.sav' /KEEP=rvar0000.
TEMP.
SEL IF $CASENUM=1.
FRE rvar0000.
> I need this to pass a count of values of a variable to my program in
> sax basic for further computations...
--
Bjarte Aagnes