Loop and concatenate name

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

jgroman77
Posts: 2
Joined: Tue Sep 24, 2013 3:40 pm

Loop and concatenate name

Postby jgroman77 » Tue Sep 24, 2013 3:52 pm

I would like to implemment the following syntax in a loop, but I don't know how to concatenate the name in the command to save the files.

GET
FILE='X:\atus\admin\ahtus\data\2003\01_orig\download\usa0312quest.sav'.

select if wave=1.

save outfile='X:\atus\admin\ahtus\data\2003\01_orig\download\usa2003quest.sav'.


GET
FILE='X:\atus\admin\ahtus\data\2003\01_orig\download\usa0312quest.sav'.

select if wave=2.

save outfile='X:\atus\admin\ahtus\data\2003\01_orig\download\usa2004quest.sav'.


GET
FILE='X:\atus\admin\ahtus\data\2003\01_orig\download\usa0312quest.sav'.

select if wave=3.

save outfile='X:\atus\admin\ahtus\data\2003\01_orig\download\usa2005quest.sav'.


GET
FILE='X:\atus\admin\ahtus\data\2003\01_orig\download\usa0312quest.sav'.

select if wave=4.

save outfile='X:\atus\admin\ahtus\data\2003\01_orig\download\usa2006quest.sav'.
pythonforspss.org
Posts: 116
Joined: Sat Oct 06, 2012 6:21 am

Re: Loop and concatenate name

Postby pythonforspss.org » Tue Sep 24, 2013 4:17 pm

For a demonstration of how to do this way more efficiently, see http://www.spss-tutorials.com/create-di ... nt-groups/.
Kind regards,

Ruben Geert van den Berg
http://www.spss-tutorials.com

Who is online

Users browsing this forum: No registered users and 2 guests

cron