I am trying to restructure one .sav file using VARSTOCASES command and i got one syntax from IBM site,but i didn't get any examples for the same so i tried with some variables but its not working,Can anyone help for this
Actual Syntax from IBM Site
VARSTOCASES
/MAKE new variable ["label"] [FROM] varlist [/MAKE ...]
[/INDEX = {new variable ["label"] }]
{new variable ["label"] (make variable name) }
{new variable ["label"] (n) new variable ["label"](n) ...}
[/ID = new variable ["label"]]
[/NULL = {DROP**}]
{KEEP }
[/COUNT=new variable ["label"]]
[/KEEP={ALL** }] [/DROP=varlist]
{varlist}
My code
GET
FILE='D:\SPSStoCSV\FileFormator\bin\FILES\Argentina\Temp.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
VARSTOCASES
/MAKE new variable VariableName1 [FROM] varlist [/MAKE Purchp6m_2 Purchp6m_4]
[/INDEX = {new variable VariableName1 }]
{new variable VariableName1 (make variable name) }
{new variable VariableName1 (3) new variable VariableName1(3) ...}
[/ID = new variable VariableName1]
[/NULL = {DROP**}]
{KEEP }
[/COUNT=new variable VariableName1]
[/KEEP={ALL** }] [/DROP=varlist]
{varlist}.
SAVE TRANSLATE OUTFILE='C:\Users\10522\Desktop\Temp.csv'
/TYPE=CSV
/ENCODING='UTF8'
/MAP
/REPLACE
/FIELDNAMES
/CELLS=VALUES.
here i want to keep all the variables except these 2(Purchp6m_2 Purchp6m_4)in KEEP command,Here i have some 150 variables so instead of keeping all the 148 variable names in the KEEP command i am trying like All** and DROP command, but this is giving all data without restructuring any of the variables.I am trying to avoid adding all the remaining variables in the KEEP command.