hi there,
i am using the following code to dynamically import the data:
it is working all right if my "tbl_in" is same as its defined i.e. upper case, but its not working it is in lower case i.e. "ver_voal_std.csv"
%let tbl_in = VER_VOAL_STD.csv;
PROC IMPORT datafile = "&FromLoc.&tbl_in."
OUT= %sysfunc(compress(&Prefix. &OutName.))
DBMS=csv REPLACE;
getnames=yes;
RUN;
anybody can help me how can i fix that?
Thanks,
KP
Hi,
You could try using the %upcase function when referencing the macro variable. E.g.:
PROC IMPORT datafile = "&FromLoc.%upcase(&tbl_in.)"
The periods (.) should also no longer be necessary.
Regards,
Amir.
Hi,
You could try using the %upcase function when referencing the macro variable. E.g.:
PROC IMPORT datafile = "&FromLoc.%upcase(&tbl_in.)"
The periods (.) should also no longer be necessary.
Regards,
Amir.
Hi,
I just realised the ".csv" extension was lowercase, so perhaps that would have to be separate to the rest of the file name in another macro variable.
See what your testing reveals.
Regards,
Amir.
Hi Amir,
thanks a lot.
Its working using %upcase();
Thanks,
KP
If your SAS process runs on a UNIX platform, filenames (as everything else in UNIX) are case sensitive.
"VER_VOAL_STD.csv", "ver_voal_std.csv", "VER_VOAL_STD.CSV" and "ver_voal_std.CSV" are all different objects and can exist side by side. (Also "Ver_voal_std.csv", you get the idea)
Define a standard way to write filenames (all lower case preferred) to make life easier, but also make sure that the case-sensitiveness is kept throughout the process. Make no assumptions, but use names "as is".
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.