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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.