Hello @Sean_OConnor,
Assuming that your file has fixed field widths, here's a simple code example using formatted input (which I prefer to column input) and five variables:
/* Create test data for demonstration */
filename ft15f001 temp;
parmcards;
B.1.1.52911,222,333.00-12987SOMETEXT
B.1.351 S49,999.95 17 101shorter
;
/* Read test data */
data want;
infile ft15f001 truncover;
input var1 $9.
var2 comma13.
var3 3.
var4 3.
var5 $upcase8.;
run;
The TRUNCOVER option helps to avoid problems if the record length may vary (as in the example). The length specifications (9, 13, 3, ...) in each informat are important as they determine the columns to be read for each variable (i.e., columns 1 - 9 for VAR1, 10 - 22 for VAR2, ...). For the character variables they also define the lengths (if not defined otherwise, e.g., by a LENGTH statement). Use character informats for character variables and numeric informats for numeric variables. (Note that the SAS variable type can differ from the raw data type, e.g., the numeric DATE9. informat can read an "alphanumeric" field with data like 01Jan2022 and vice versa, as mentioned by ballardw.) Of course, your INFILE statement will refer to a different file name or to a physical path.
... View more