DATA Step, Macro, Functions and more

input

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

input

Given the contents of the raw data file TYPECOLOR.DAT:

Untitled.png

Why is the Ans is Type=daisy, Color=     

Please help, thanks!


Accepted Solutions
Solution
‎10-05-2017 03:43 AM
Contributor
Posts: 29

Re: input

you need a delimiter a space maybe to read two words .. or use column input instead of presetting the lenghts for the variables something like

data flowers;

infile filename;

input flower $ 1-5  color $ 7-12;

run;

 

 

 

View solution in original post


All Replies
Super User
Posts: 9,923

Re: input

How about engaging your own brain, for a change?

The answer is THAT simple.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Solution
‎10-05-2017 03:43 AM
Contributor
Posts: 29

Re: input

you need a delimiter a space maybe to read two words .. or use column input instead of presetting the lenghts for the variables something like

data flowers;

infile filename;

input flower $ 1-5  color $ 7-12;

run;

 

 

 

Contributor
Posts: 31

Re: input

Posted in reply to ali_jooan
I see, Thanks!!!
☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 123 views
  • 1 like
  • 3 in conversation