Hi!
I'm trying to create a table with data. where the first column must be numerical(integer) and second column must be float number.
The following code does it except first 9 rows where int number is less then 10.
The code:
DATA Lapse_Multipliers;
input Years 1-2 Lapse_Multipliers 3-6;
DATALINES;
1 1
2 1
3 1
4 1
5 1
6 0.9
7 0.8
8 0.7
9 0.5
10 1
11 1
12 1
13 1
14 1
15 1
16 0.9
17 0.8
18 0.7
19 0.5
20 1
;
run;It returns:
. 1 . 1 . 1 . 1 . 1 . 0.9 . 0.8 . 0.7 . 0.5 10 1 11 1 12 1 13 1 14 1 15 1 16 0.9 17 0.8 18 0.7 19 0.5 20 1
What am I missing?
Do not use tabs in DATALINES blocks, unless you want to use them explicitly as delimiters, in which case your code should be
data lapse_multipliers;
infile datalines dlm="09"x dsd;
input Years Lapse_Multipliers;
datalines;
1 1
Do not use tabs in DATALINES blocks, unless you want to use them explicitly as delimiters, in which case your code should be
data lapse_multipliers;
infile datalines dlm="09"x dsd;
input Years Lapse_Multipliers;
datalines;
1 1
@IgorR wrote:
Thank you!
Now it works.
The data in datalines comes with Tabs because I'm copy-pasting the data from excel file.
You must be stuck with using SAS/Studio interface instead of Display Manager.
In Display Manager you are protected from the tabs that accidentally get into your code because when you SUBMIT the code any tabs are replaced by the appropriate number of spaces to move to the next tab stop.
Note that SAS let's you fix this by changing your preferences settings so that spaces are substituted for tabs. So when typing you can still hit the TAB key to indent code, but without the complication of having actual '09'x characters hiding in your code.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.