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
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.