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

Hello Friends

I have issue in executing this program.  Can you please guide me on this?  Is there problem with this code?

Your help is highly appreciated.

data dates;
input @1 subject @4 date_of_birth mmddyy8. @12 visit_date date9.;@12 visit_date date9.;
datalines;
0011021195011Nov2006
0020802196212Dec2010
0030125195502Jan2011
;
run;
proc print;
format date_of_birth date9.
visit_date mmddyy10.;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
sas_td2016
Obsidian | Level 7

Thanks.  It is working.

View solution in original post

5 REPLIES 5
Ksharp
Super User

data dates;
input  subject $3.   date_of_birth mmddyy8.  visit_date date9.;
format visit_date date9. date_of_birth mmddyy10.;
datalines;
0011021195011Nov2006
0020802196212Dec2010
0030125195502Jan2011
;
run;
proc print;run;

sas_td2016
Obsidian | Level 7

Thanks.  It is working.

Reeza
Super User

@sas_td2016 When marking a correct answer please mark the answer that helped you, NOT your own response. 

Astounding
PROC Star

The source of the problem is (as was indicated) reading in SUBJECT.  Your program tells SAS to start at column 1, but doesn't tell it where to finish.  As a result, SAS keeps reading until it either hits a blank or hits the end of the line,.

sas_td2016
Obsidian | Level 7

thanks for your input.  So here we need not to use column input, right?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1191 views
  • 0 likes
  • 4 in conversation