Hello,
I searched through the internet, wherever I could find the answer. Here's my problem: I need to import a csv that is always chaging the name (isn't a piece of cake, I know :(, but i cannot modify this process). It is possible to prompt the user to specify the file path?
Any help is greatly appreciated.
Thank you.
M
🙂
Within EG, you could specify a project prompt (see the EG online help about "Working with prompts"). You can create a simple text prompt, or a more specific "File selection" prompt.
If you can't change the name of the file = your import documentation is broken. How will you be versioning the file, what is the traceability.
Aside from that there are prompts in EG:
http://support.sas.com/resources/papers/proceedings17/0818-2017.pdf
But if you can't fix down the naming, can you not just save the file in one directory on its own, that way you could just use a wildcard:
data want; infile ".../*.csv"; ... run;
Would save some hassle.
Hello,
Thank you for the answers!
I tried to do the prompt type File or directory, however it does not access to my own pc, but rather access to the SAS Server.
Do you know how can I do this?
Thanks in advance,
Mariana
You might not be able to get the "local" file dialog for that file browser. You might need to settle for a simple text prompt (type in the value). You can seed the value with a default that might work much of the time, depending how consistent the file locations are.
In order for the code that follows to be able to run, the file you select must be available to the SAS server. So, selecting a local CSV file and then expecting a remote DATA step to process it -- that won't work.
If that's your situation, you can use the Data->Copy Files task (EG 7.13 and later) to copy a local file to a remote SAS and then import it. The Copy Files task accepts wildcards and macro variables, so you really can generalize it for different scenarios. You would be doing the opposite of this: Export and download any file.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: