I have a large, multi-GB .txt file to import into SAS. (my SAS is running on a remote server)
First, I FTP transferred my .txt file to the server itself.
Next, I launched the Import Wizard from my local E.G. client, but whats happening is "Retrieving Source File" - which is silly because the data is already there.
How can I import the .txt file most efficiently? I am aware of proc IMPORT but then I lose the ability to review the datatypes during the EG wizard.
Is this a one time process?
In general, it's best to use a data step to read the file, but that means explicitly listing fields/types.
The 'lazy trick' is to use proc import, most likely with option obs= set to generate the code.
Take the code from the log, review and customize the code as desired and run from there.
option obs=100000;
proc import ...
run;
Grab code from log and you're good to go. You can use ALT+Click to select code without log numbers.
Press the ALT key and at the same time select the top left-hand corner of your log in the column just to the right of your line numbers by clicking with your mouse button. Now drag the mouse down to the bottom right-hand corner of your log. You should now have highlighted your SAS program without the line numbers.
Courtesy of @SASKiwi
https://communities.sas.com/t5/SAS-Procedures/How-to-remove-log-numbers/td-p/21489
Is this a one time process?
In general, it's best to use a data step to read the file, but that means explicitly listing fields/types.
The 'lazy trick' is to use proc import, most likely with option obs= set to generate the code.
Take the code from the log, review and customize the code as desired and run from there.
option obs=100000;
proc import ...
run;
Grab code from log and you're good to go. You can use ALT+Click to select code without log numbers.
Press the ALT key and at the same time select the top left-hand corner of your log in the column just to the right of your line numbers by clicking with your mouse button. Now drag the mouse down to the bottom right-hand corner of your log. You should now have highlighted your SAS program without the line numbers.
Courtesy of @SASKiwi
https://communities.sas.com/t5/SAS-Procedures/How-to-remove-log-numbers/td-p/21489
Still a pain - that the client needs to bring back all the data like that - but your "lazy" trick is incredible and I very much appreciate it!
The added bonus is the Alt+Click trick, which I am sure will serve me well many times in my career.
Thanks!
If your lucky 😉 your client may have provided a data transfer agreement with the data specifications. If so, I usually find a way to create my informat/input statements from that. There's a variety of ways - usually I use Excel to build it since I can customize and make it semi-automated manner.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.