Yes, the 1 indicated length and could either be specified as the default when you create the informat or, like I did, when you use the informat.
I had to guess at the new informat you introduced, but the following reads the kind of data that I think you are dealing with:
proc format;
invalue chtono
Y=1
N=2
X=.N
other=.U;
invalue degf
H=1
A=2
B=3
M=4
X=.N
other=.U;
run;
data want;
input @1 (fdobmo fdobdy) (2.)
(ever_mar married pat_ack) (chtono1.)
mat_deg degf1.;
cards;
0315YYYH
0617XXUB
1002NN2M
12142NXX
;
run;
proc format;
invalue chtono (default=1)
'Y'= 1
'N'= 2
'X'= .N
other= .U;
run;
data want;
input @1 x chtono. /* since defined default in proc format do not need to define chtono<w>. */
@2 y chtono. /* could just use chtono1. instead for same result */;
cards;
12
YN
XY
NX
21
;
proc print data=want noobs;
run;
x y
U U
1 2
N 1
2 N
U U
Thanks to you both. Think it's working! Didn't know about the default option - the learning never stops. This is a huuuuggge help and I appreciate your time.
SAS treat . .A - .Z all as numeric missing value.
.A - .Z are valid numeric invalues:
data _null_;
input x @@;
cards;
.A .B .C .D
.E .F .G .H
.I .J .K .L
.M .N .O .P
.Q .R .S .T
.U .V .W .X
.Y .Z
;
proc print; where x <= .E;
run;
Obs x
1 A
2 B
3 C
4 D
5 E
Yes.But they are all missing value for numeric type, just like dot.
Ksharp
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.