How could I correctly output all my datalines with the code I have?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

How could I correctly output all my datalines with the code I have?

Hello All, 

 

I have been having so trouble with getting SAS program to print out all the datalines. What I am doing wrong? Here is my code below: 

 

data Date_Test; 
     input Month Day Year Date;   
  format Date date9.;
  
datalines; 
10 21 1998
3 4 2015
1 1 1960
;
run;

title "A DataSet Named Date_Test"; 
proc print data=Date_Test noobs; 
run;

Accepted Solutions
Solution
‎11-20-2017 09:10 AM
PROC Star
Posts: 8,149

Re: How could I correctly output all my datalines with the code I have?

Try:

data Date_Test;
  informat date anydtdte.;
  input Month Day Year @1 Date &;   
  format Date date9.;
  
datalines; 
10 21 1998
3 4 2015
1 1 1960
;
run;

title "A DataSet Named Date_Test"; 
proc print data=Date_Test noobs; 
run;

Art, CEO, AnalystFinder.com

 

View solution in original post


All Replies
Solution
‎11-20-2017 09:10 AM
PROC Star
Posts: 8,149

Re: How could I correctly output all my datalines with the code I have?

Try:

data Date_Test;
  informat date anydtdte.;
  input Month Day Year @1 Date &;   
  format Date date9.;
  
datalines; 
10 21 1998
3 4 2015
1 1 1960
;
run;

title "A DataSet Named Date_Test"; 
proc print data=Date_Test noobs; 
run;

Art, CEO, AnalystFinder.com

 

Occasional Contributor
Posts: 13

Re: How could I correctly output all my datalines with the code I have?

Thank you!

Super User
Super User
Posts: 9,416

Re: How could I correctly output all my datalines with the code I have?

Please mark @art297's answer as correct if that is the answer to your question.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 128 views
  • 0 likes
  • 3 in conversation