BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SannaSanna
Quartz | Level 8

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;

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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.

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

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.

SannaSanna
Quartz | Level 8

Ohh thank you.  I had forgotten to set lrecl.

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1274 views
  • 1 like
  • 2 in conversation