I'm trying to write a Macro to import 15 files, all in the same format. The name format is the "monyy PSF Extract". So I can use the code below to read in the 1 file for Nov11. I've tried to find a way of using the macro to read in also the other 14 files. I can't seem to make it work. I'm new to SPSS - I knew how to do this in SAS. I also want to set the dataset created to be named monyy. I will also want to rename some variables as original_name_monyy.
Can someone help me on this please?It is drivign me nuts!
define !XLSFILE() !quote(!con("S:\Credit Risk\Credit Risk\Elisabeth\",!unquote(!eval(!cq)), ".xlsx")) !enddefine.
define !cq(mon = !DEFAULT ("Nov11") !token(1) /name = !DEFAULT ("PSF Extract") !TOKENS(2)) !quo(!con(!unq(!mon),!unq(" "), !unq(!name))) !enddefine.
/* import xlsx file */.
GET DATA
/TYPE=XLSX
/FILE=!XLSFILE
/SHEET=name 'Sheet1'
/CELLRANGE=full
/READNAMES=on
/ASSUMEDSTRWIDTH=32767.
EXECUTE.
DATASET NAME test WINDOW=FRONT.