Not registered yet?
Register now! It is easy and done in 1 minute and gives you access to special discounts and much more!
What is the difference between import a large csv file into SAS by code and using the import wizard (point and click)? Will the data imported in SAS be different?
It depends. There are several ways to import a file:
The third is the most accurate because you've explicitly specified things.
If you do the same in the EG task your data will be the same. However, if you don't modify the automatic settings you'll get something more similar to PROC IMPORT.
PROC IMPORT guesses at types and lengths so it may not be correct.
Basically, there is no guarantee that the results of any of these methods will be the exact same depending on what options you pick.
The most accurate is the data step, followed by EG task where you customize each format/type and then PROC IMPORT with GUESSINGROWS=MAX option. This option forces SAS to scan the entire file before picking lengths and types so it's more likely to be accurate.
Thanks Reeza. Could you give me an example of importing a csv file into SAS by Data step code please? @Reeza
Beside, do I need more code to ensure the accuracy of imported date if the csv file is large?
The difference is your comfort with either method. As @Joe answered, the Import Data wizard writes SAS code. Thus, it has all of the options available to it which are available in the PROC IMPORT.
The structure of the data imported, relative to its original structure in the CSV file solely depends on the options you chose to use in either import method.
Short Answer: The data will be the same.
The Import Data wizard is a code-writer, so it actually writes SAS code to perform the input. As such, it is no different than writing your own PROC IMPORT step, except that it has certain defaults.
You can check an option to ask it to write the code it produces to the log; that is often what I use the point and click interface for, to write the code partially, and then I update specifics it doesn't handle properly.