options nosymbolgen nomtrace nonotes nosource noMPRINT;
%macro datm4;
%do i=1 %to 10;
data result&I ;
/*inialization of flag to 0 which will be used to find line of interest*/
retain flag_section1 0 ;
infile "FOLDERS/myfolders/FINALSAS/DATA/TEST&i..nm7/TEST&i..lst" END=EOF;
if index(_infile_ , 'NO. OF SIG. DIGITS IN FINAL EST.:') and scan(_infile_, -1,'') = '2.9' then flag_section1 =1;
input @; if _infile_ =: 'NO. OF SIG. DIGITS IN FINAL EST.: 2.9' then flag_section1 =1;
if eof then output;
run;
%END;
TITLE ' DISTRIBUTION D DATA';
data FLAG;
set %do i=1 %to 10;RESULT&i %end ;;
run;
%mend datm4;
%datm4;
PROC EXPORT DATA=flag
OUTFILE= '/folders/myfolders/FINALSAS/Flag.XLSX '
DBMS=XLSX REPLACE;
RUN;
The program above runs ok on my laptop. Before I ran the code on the workstation I checked the properties and the location was given as:/folders/myfolders/myfolders/finalsas/…..
I got the following error message which is listed for 7 but applies to all N=10 folders:
Can anyone tell me why using the path from the pull down properties tab in SAS UE, although it has an extra myfolders, does not work?
infile "/folders/myfolders/FINALSAS/DATA/TEST&i..nm7/TEST&i..lst" END=EOF;
The path is case sensitive since SAS UE uses a Unix file system.
This seems like a way to read the output from Listing, which is likely old code I'm assuming or a PROC that doesn't support ODS tables.
READ the error message. It is telling you where you told the program to read from:
/opt/sasinside/SASConfig/Lev1/SASApp/FOLDERS/Myfolders/myfolders/FINALSAS/DATA/TEST7.nm7/TEST7.lst.
You don't say what environment you are using, whether SAS UE or not.
I suspect the issue may be either missing a / before FOLDERS
or running connected to a server that can't find the path because the server doesn't have permissions to read from the location.
I find the capitalization a bit odd as most people with similar error messages show the path in all lower case. If you are running in SAS University edition then that is a Linux system and the path is case sensitive for each and every folder name and likely expects lower case as well as the /folders start to the path.
You have one "myfolders" too many in the path.
infile "/folders/myfolders/FINALSAS/DATA/TEST&i..nm7/TEST&i..lst" END=EOF;
The path is case sensitive since SAS UE uses a Unix file system.
This seems like a way to read the output from Listing, which is likely old code I'm assuming or a PROC that doesn't support ODS tables.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.