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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 798 views
  • 3 likes
  • 3 in conversation