Hello, I am practicing reading files into SAS, and I need a little bit of clarification about when I would use the different ways of reading data in from external files. 1. What type of files do I use PROC IMPORT for? Do I only use PROC IMPORT for Excel, CSV and SPSS files? 2. When I use an infile statement to read in a file, do I then use the following steps? DATA XXX; INFILE'XXXX' DLM='X' firstobs=2 truncover INFORMAT XXXX anydtdtm30. YYY $14.; INPUT FORMAT /*This one is optional though right? For example, if I want to format my fields in a specific way then I would put the format statement here. Like for example for a date field I can set how I want to the date to be displayed here?*/ Run; 3. How are the steps above different than the steps below? The below code works to read in some data, but why do I not need to put in an INFORMAT statement for the below? Why does LENGTH work below? data phone;
infile '/sscc/home/m/mkh246/Textbook_Datasets/Listing of Phone.csv' dlm=',' firstobs=2 truncover;
length phone $16;
input phone &;
Run; Any insight on the differences would be so helpful. Thank you!
... View more