Ok I have set a Macro Dpull and It works fine. Now I'm setting up a macro Drun. Drum is supposed to take a list of file names from a txt document and then use that list in place of fname in the Dpull macro. But I cant seem to get it to work. Hopefully you can help thank you all. Here is the code.
%macro Dpull (fname);
data A_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs= 13;
input time code $;
run;
Data B_&fname;
set A_&fname;
if code = "neutral" then emotion2=1;
if code = "angry" then emotion2=2;
if code = "happy" then emotion2=3;
if code = "surprise" then emotion2=4;
if code = "fear" then emotion2=5;
if code = "other" then emotion2=6;
if code = "flat" then expressiveness2=1;
if code = "mild" then expressiveness2=2;
if code = "moderate" then expressiveness2=3;
if code = "extreme" then expressiveness2=4;
if code = "fully" then naturaleness2=1;
if code = "slightly" then naturaleness2=2;
if code = "very" then naturaleness2=3;
if code = "unnatural" then naturaleness2=4;
if code = "on" then gaze2=1;
if code = "away" then gaze2=2;
data C_&fname;
set B_&fname;
emotion = lag3(emotion2);
expressiveness = lag2(expressiveness2);
naturaleness = lag(naturaleness2);
gaze = gaze2;
data D_&fname;
set C_&fname (keep = emotion expressiveness naturaleness gaze time);
if gaze = "." then delete;
Emot = time||"_Emot";
Expr = time||"_Expr";
Natu = time||"_Natu";
Gaz1 = time||"_Gaze";
Proc transpose data = D_&fname out = Emot_&fname;
ID Emot;
var emotion;
Proc transpose data = D_&fname out = Expr_&fname;
ID Expr;
var expressiveness;
Proc transpose data = D_&fname out = Natu_&fname;
ID Natu;
var naturaleness;
Proc transpose data = D_&fname out = Gaz1_&fname;
ID Gaz1;
var gaze;
Data E_&fname;
merge Emot_&fname Expr_&fname Natu_&fname Gaz1_&fname;
run;
data AA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=11;
input coder $;
run;
data AB_&fname;
Set AA_&fname (obs = 1);
data BA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=7;
input sub $1-69;
run;
data BB_&fname;
Set BA_&fname (obs = 1);
SubID=substr(sub,63,7);
data BC_&fname;
Set BB_&fname (Drop= sub);
data CA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=7;
input @'.01_'AVI $;
run;
data F_&fname;
Set BC_&fname;
Set AB_&fname;
Set CA_&fname;
Set E_&fname (drop=_name_);
proc print data = F_&fname;
run;
%mend Dpull;
%macro Drun;
data AA;
infile "C:\Documents and Settings\boraste\Desktop\Data File list of names.txt";
input FileN $ @@;
run;
data _null_;
set AA;
call symput("FileN2",FileN);
run;
/*** NOW CALL YOUR MACRO DPULL ***/
%do i=1 %to 892;
%Dpull(&FileN2);
%end;
mend Drun;
%macro Dpull (fname);
data A_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs= 13;
input time code $;
run;
Data B_&fname;
set A_&fname;
if code = "neutral" then emotion2=1;
if code = "angry" then emotion2=2;
if code = "happy" then emotion2=3;
if code = "surprise" then emotion2=4;
if code = "fear" then emotion2=5;
if code = "other" then emotion2=6;
if code = "flat" then expressiveness2=1;
if code = "mild" then expressiveness2=2;
if code = "moderate" then expressiveness2=3;
if code = "extreme" then expressiveness2=4;
if code = "fully" then naturaleness2=1;
if code = "slightly" then naturaleness2=2;
if code = "very" then naturaleness2=3;
if code = "unnatural" then naturaleness2=4;
if code = "on" then gaze2=1;
if code = "away" then gaze2=2;
data C_&fname;
set B_&fname;
emotion = lag3(emotion2);
expressiveness = lag2(expressiveness2);
naturaleness = lag(naturaleness2);
gaze = gaze2;
data D_&fname;
set C_&fname (keep = emotion expressiveness naturaleness gaze time);
if gaze = "." then delete;
Emot = time||"_Emot";
Expr = time||"_Expr";
Natu = time||"_Natu";
Gaz1 = time||"_Gaze";
Proc transpose data = D_&fname out = Emot_&fname;
ID Emot;
var emotion;
Proc transpose data = D_&fname out = Expr_&fname;
ID Expr;
var expressiveness;
Proc transpose data = D_&fname out = Natu_&fname;
ID Natu;
var naturaleness;
Proc transpose data = D_&fname out = Gaz1_&fname;
ID Gaz1;
var gaze;
Data E_&fname;
merge Emot_&fname Expr_&fname Natu_&fname Gaz1_&fname;
run;
data AA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=11;
input coder $;
run;
data AB_&fname;
Set AA_&fname (obs = 1);
data BA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=7;
input sub $1-69;
run;
data BB_&fname;
Set BA_&fname (obs = 1);
SubID=substr(sub,63,7);
data BC_&fname;
Set BB_&fname (Drop= sub);
data CA_&fname;
infile "\\Ad.bu.edu\dfs\bumc\BUSM\Anatomy and Neurobiology\Dept\LDCN\Autism\U-19 2002-2007\Wave3_PII\Production study\
Face Coding - Noldus\Noldus\The Observer\Workspaces\Projects\testing face coding2\Data Files cleaned\&fname..odf" firstobs=7;
input @'.01_'AVI $;
run;
data F_&fname;
Set BC_&fname;
Set AB_&fname;
Set CA_&fname;
Set E_&fname (drop=_name_);
proc print data = F_&fname;
run;
%mend Dpull;
%macro Drun;
data AA;
infile "C:\Documents and Settings\boraste\Desktop\Data File list of names.txt";
input FileN $ @@;
run;
data _null_;
set AA;
call symput("FileN2",FileN);
run;
/*** NOW CALL YOUR MACRO DPULL ***/
%do i=1 %to 892;
%Dpull(&FileN2);
%end;
mend Drun;