I'd like to get a list of formats used for each variable in the INPUT section. For example, say, we have a csv file and manually import data into SAS. In the code section, we will have smth like that:
DATA WORK.SAS_data_1;
LENGTH
A 8
B $ 9
C 8
D 8
E 8 ;
FORMAT
A BEST1.
B $CHAR9.
C MMDDYY10.
D BEST1.
E BEST3. ;
INFORMAT
A BEST1.
B $CHAR9.
C MMDDYY10.
D BEST1.
E BEST3. ;
INFILE 'C:\Users\AppData\Local\Temp\SEG3592\SAS_data_1-ab6243ce7f064047b5e010c113d2f6a3.txt'
LRECL=27
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD ;
INPUT
A : ?? BEST1.
B : $CHAR9.
C : ?? MMDDYY9.
D : ?? BEST1.
E : ?? BEST3. ;
RUN;
I'd like to know what formats are used in the INPUT section, that is: BEST1. for A, $CHAR9. for B, MMDDYY9. for C, etc.
I've found the code that summaries the format and informat for each variable in SASHELP.CARS dataset but I cannot find the format used in the INPUT section. Does anyone know where to find it? At times (for numerical variables) these formats can be different. Here is the code:
proc sql noprint ;
create table varlist as
select memname,varnum,name,type,length,format,informat, label
from dictionary.columns
where libname='SASHELP' and memname='CARS'
;
quit;
Thank you.
BEST.
is used at the import stage?) – Dominic Comtoisformat
andinformat
are different - you almost certainly meaninformat
(the bit in the input code would be an informat). – Joe