Database Reference
In-Depth Information
NOTE: In Example 2.2 in Chapter 2, the code for PROC EXPORT used the PUTNAMES=NO option to write
the 'c:\My_Files\Shoes.csv' output file with no variable names in the first row of the file.
The output log listing below shows the External File Interface SAS code created by the “Generated SAS
Datastep” when the PROC IMPORT step above ran. Notice that the input *.csv file did not have a row of
headers associated with the data. So, SAS assigned variable names to the input variables (VAR1 to VAR7).
PROC IMPORT
DATAFILE='c:\My_Files\Shoes.txt'
DBMS=DLM
OUT=shoes
REPLACE;
DELIMITER=',';
DATAROW= 1 ;
GETNAMES=NO;
GUESSINGROWS= 400 ;
RUN ;
Output 3.1: Listing of the External File Interface Code Generated.
1
2 PROC IMPORT
3 DATAFILE='c:\My_Files\Shoes.txt'
4 DBMS=DLM
5 OUT=shoes
6 REPLACE;
7
8 DELIMITER=',';
9 DATAROW=1;
10 GETNAMES=NO;
11 GUESSINGROWS=400;
12 RUN;
13 /**********************************************************************
14 * PRODUCT: SAS
15 * VERSION: 9.4
16 * CREATOR: External File Interface
17 * DATE: 17FEB14
18 * DESC: Generated SAS Datastep Code
19 * TEMPLATE SOURCE: (None Specified.)
20 ***********************************************************************/
21 data WORK.SHOES ;
22 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
23 infile 'c:\My_Files\Shoes.txt' delimiter = ',' MISSOVER DSD lrecl=32767 ;
24 informat VAR1 $25. ;
25 informat VAR2 $14. ;
26 informat VAR3 $12. ;
27 informat VAR4 best32. ;
28 informat VAR5 $12. ;
29 informat VAR6 $12. ;
30 informat VAR7 $9. ;
31 format VAR1 $25. ;
32 format VAR2 $14. ;
33 format VAR3 $12. ;
34 format VAR4 best12. ;
35 format VAR5 $12. ;
36 format VAR6 $12. ;
37 format VAR7 $9. ;
38 input
 
Search WWH ::




Custom Search