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

;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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