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

I have a question about something I must have forgotten...

Why does test1 fail, but not test2 or test3?

data test1;
informat d date9.;
input d 1-9;
datalines;
01JAN1999
;

data test2;
length dTxt $9;
input dTxt 1-9;
d = input (dTxt, date9.);
datalines;
01JAN1999
;

data test3;
input d :date9.;
datalines;
01JAN1999
;

PG

PG
1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

According to the documentation:

Note:   You cannot use an informat with column input.


View solution in original post

3 REPLIES 3
art297
Opal | Level 21

According to the documentation:

Note:   You cannot use an informat with column input.


PGStats
Opal | Level 21

That settles that! Thanks.

PG

PG
Tom
Super User Tom
Super User

Use @.

data test1b;

informat d date9.;

format d date9.;

input @1 d ;

put d=;

datalines;

01JAN1999

;

data test1c;

format d date9.;

input @1 d date9.;

put d=;

datalines;

01JAN1999

;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1528 views
  • 3 likes
  • 3 in conversation