0
votes

I keep getting this error code over and over, with different line numbers of course.

NOTE: Invalid data for VAR4 in line 264808 30-30.
RULE:----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+
264808    F113Q1008712|201506|43003.27|R|28|332|N||||3.375|0|201412|||| 61
VAR1=F113Q1008712 VAR2=201506 VAR3=43003.27 VAR4=. VAR5=28 VAR6=332 VAR7=N VAR8=  VAR9=
VAR10=  VAR11=3.375 VAR12=0 VAR13=2 VAR14=  VAR15=  VAR16=  VAR17=  _ERROR_=1 _N_=264808

After enough time I this happening I get this error code:

WARNING: Limit set by ERRORS= option reached Further errors of this type will not be printed.

I'm assuming it is a problem with the delimiter (pipe '|' in my case). I found another question that said:

"If it's actually tab delimited, you may need to use dlm='09'x instead." I guess my problem is my lack of understanding of coding. (I'm just using SAS to supplement my thesis, so a lot of this is learning as I'm going.) Where would I put dlm='09'x at and would it even help me in my case.

I also found a comment on another question that said:

"The $ makes it a character variable, not a numeric variable. That will almost certainly override any informat errors (since character variables are very flexible) but won't give you necessarily the right results.:)"

After reading those answers I believe I need to somehow tell SAS to accept the numerical value that can appear in Var4 and also the variable value of 'R'. Is there a way to make SAS accept either. Or am I just going to have to change all of my 'R' to a numerical value?

If it helps I'm inputting into SAS using this code:

proc import datafile="E:\2013\historical_data1_time_Q12013.txt"
     out=TYr2013Q1
     dbms=dlm
     replace;
     delimiter='|';
     getnames=no;
run;

Thanks for any help. It's much appreciated.

1
I don't see any indication that your data are tab delimited, I see PIPE |. VAR4 is determined by PROC IMPORT to be numeric but in line 264808 or your data it finds R. I think the missing statement may be helpful.data _null_
What is "R" meaning? Like "Refused" ? Or is it a meaningful vale of some sort?Joe
R means that it has been defaulted for so long that it got Repossessed.Fmonkey2001

1 Answers

1
votes

This example shows how to use the MISSING statement to read the character R as missing R .R into a numeric variable using PROC IMPORT.

enter image description here

filename FT15F001 temp;
proc import datafile=FT15F001 out=test replace dbms=dlm;
   missing r;
   delimiter='|';
   getnames=no;
   guessingrows=1;
   parmcards;
1|2|3|4
1|r|3|5
;;;;
   run;