Hi,
I'm trying to batch process about 80 txt files (filenames begin with "U") and would like to append them into a single SPSS file. My syntax looks like this:
define !out () !quote(!concat(!unquote(!eval(!JOB_OUTPUTDATADIR)),
!unquote(!eval(!JOB_DATAFILEROOT)),
".sav")) !enddefine.
SPSSINC PROCESS FILES
INPUTDATA="/Users/sarah/Desktop/Data/output data/U*.txt"
SYNTAX="/Users/sarah/Desktop/Data/output data/STUDYID.sps"
OUTPUTDATADIR="/Users/sarah/Desktop/Data/output data" CONTINUEONERROR=YES
VIEWERDIR= "/Users/sarah/Desktop/Data/output data" CLOSEDATA=YES
LOGFILE= "/Users/sarahherzog/Desktop/Data/output data/masterfile.txt" MACRONAME="!JOB"
LOGFILEMODE=APPEND
/MACRODEFS ITEMS QPARM1="JOB".
When I run this, I get the error "“The procedure cannot access a file with the given file specification: /Users/sarah/Desktop/Data/output data/masterfile.txt for keyword LOGFILE.”
'masterfile.txt' doesn't actually exist, I had assumed the LOGFILE path required the name for the file that the output would be appended to. Did I get that wrong?
I also tried the above syntax without the LOGFILE line, and it transformed several txt files to SPSS before stopping with the error: "Output document NAME='^1"
In case the problem is my syntax file STUDYID, this is the content of the syntax:
PRESERVE.
SET DECIMAL DOT.
GET DATA /TYPE=TXT
/FILE=JOB_INPUTFILE
/ENCODING='UTF8'
/DELIMITERS="\t"
/QUALIFIER='"'
/ARRANGEMENT=DELIMITED
/FIRSTCASE=2
/DATATYPEMIN PERCENTAGE=95.0
/VARIABLES=
StartEvent AUTO
StartTime AUTO
EndEvent AUTO
EndTime AUTO
SegmentDuration AUTO
ManualOverride AUTO
Thresholdvolts AUTO
MeanHeartRate AUTO
RSA AUTO
MeanIBI AUTO
Support Member#ofRsFound AUTO
RespirationRate AUTO
RespirationAmplitude AUTO
RespirationPeakFrequency AUTO
RespirationPower AUTO
FirstECGRTime AUTO
LastECGRTime AUTO
FirstRtoLastRDuration AUTO
SDNN AUTO
AVNN AUTO
RMSSD AUTO
NN50 AUTO
pNN50 AUTO
/MAP.
RESTORE.
CACHE.
EXECUTE.
DATASET NAME DataSet3 WINDOW=FRONT.
STRING STUDYID (A10).
COMPUTE STUDYID=CHAR.SUBSTR(StartEvent,1,6).
EXECUTE.
ADD FILES file *
/KEEP STUDYID all.
EXECUTE.
Thanks so much!
#SPSSStatistics#Support#SupportMigration