Hello-
I am trying to read in a text file (pointer/postion file) I am following the file layout (start and stop positons) but it seems SAS is not reading/scanning the data positions I've specified. I've attached my code below - for the very last variable, SAS seems to be starting back at position 1. (everything looks fine in output except for the very last variable)
DATA file1; INFILE CAH OBS=1000 ;
INPUT
@23 GRADE $2.
@25 LAST_NAME $11.
@36 FIRST_NAME $9.
@56 DOB $8.
@64 GENDER $1.
@134 ELA_MOD1 $1.
@135 ELA_MOD2 $1.
@136 ELA_MOD3 $1.
@137 ELA_MOD4 $1.
@138 ELA_MOD5 $1.
@139 ELA_MOD6 $1.
@140 ELA_MOD7 $1.
@141 ELA_MOD8 $1.
@142 ELA_MOD9 $1.
@143 ELA_MOD10 $1.
@144 ELA_MOD11 $1.
@145 ELA_MOD12 $1.
@146 ELA_MOD13 $1.
@147 ELA_MOD14 $1.
@148 ELA_MOD15 $1.
@149 ELA_MOD16 $1.
@150 ELA_MOD17 $1.
@151 ELA_MOD18 $1.
@154 ELA_MODYN $1.
@155 MATH_MOD1 $1.
@156 MATH_MOD2 $1.
@157 MATH_MOD3 $1.
@158 MATH_MOD4 $1.
@159 MATH_MOD5 $1.
@160 MATH_MOD6 $1.
@161 MATH_MOD7 $1.
@162 MATH_MOD8 $1.
@163 MATH_MOD9 $1.
@164 MATH_MOD10 $1.
@165 MATH_MOD11 $1.
@166 MATH_MOD12 $1.
@167 MATH_MOD13 $1.
@168 MATH_MOD14 $1.
@169 MATH_MOD15 $1.
@172 MATH_MODYN $1.
@203 MATH_SCORE 3.
@248 ELA_SCORE 3.
@455 SSID $10.
;
run;
add an lrecl=32767 to your infile statement. Is should be set to a number equal to or greater then the actual length of the file you are trying to read.
add an lrecl=32767 to your infile statement. Is should be set to a number equal to or greater then the actual length of the file you are trying to read.
Ohh thank you. I had forgotten to set lrecl.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.