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

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;

FriedEgg
SAS Employee

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

anjgupta
Calcite | Level 5

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.

Ksharp
Super User

SAS treat . .A - .Z  all as numeric missing value.

FriedEgg
SAS Employee

.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

Ksharp
Super User

Yes.But they are all missing value for numeric type, just like dot.

Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 20 replies
  • 3793 views
  • 6 likes
  • 4 in conversation