71 Answered Questions for the topic SAS
Sas
04/20/19
how to concatenate each record within one observation in SAS?
I wonder whether it's possible to concatenate each record within one observation with SAS code.
E.g.
Here is the original data set
**1st_name 2nd_name 3rd_name .....last_name**
abc def ghi...
more
Sas
04/20/19
How can I read a SAS dataset?
I have a lot of files in SAS format, and I'd like to be able to read them in programs outside of SAS. I don't have anything except the base SAS system installed. I could manually convert each one,...
more
Sas Proc Sql
04/19/19
Limiting results in PROC SQL?
I am trying to use PROC SQL to query a DB2 table with hundreds of millions of records. During the development stage, I want to run my query on an arbitrarily small subset of those records (say,...
more
Finding strings that differ with at most one letter from a given string in SAS with PROC SQL?
First some context. I am using proc sql in SAS, and need to fetch all the entries in a data set (with a couple of million entries) that have variable "Name" equal to (let's say) "Massachusetts". Of...
more
Sas
04/19/19
SAS memory usage and sorting?
I'm curious about SAS's use of memory, sorting, and why it seems to be so inefficient.
I have a quad core xeon with 8GB ram. I have a 3GB dataset. Why, at any given time during a standard proc...
more
Sas Sql
04/17/19
SQL/SAS: Best performance for selecting from big table (2bn rows)?
I have a non-indexed 2 billion rows table in a read-only SAS SPD server (**bigtable**). I have another 12 million rows table in my workspace (SAS_GRID) with a single column of unique ids...
more
04/17/19
SAS Display Manager commands?
The SAS display manager is a comamnd line interface to the SAS system, which remains in Base SAS as a legacy facility.
However the online documentation on how to use this facility is sparse at...
more
Sas
04/16/19
How many data types are there in SAS?
Sas Date
04/15/19
SAS. Why "Jan 11 2002" == "88399", according to documentation?
I was reading the [dates documentation][1], but couldn't understand how SAS handled the dates:
On [SAS website][2] they explain that `Jan 1 1961` is 366, which makes sense : this is the number of...
more
Is it possible to do a case-insensitive DISTINCT with SAS (PROC SQL)?
Is there a way to get the case-insensitive distinct rows from this SAS SQL query? ...
SELECT DISTINCT country FROM companies;
The ideal solution would consist of a single query.
Results now...
more
04/12/19
How to use Boolean datatype in SAS?
In many mainstream programming languages you can use Boolean data-type (for instance, value can be either `true` or `false`) - to represent binary "true/false".
Is there a Boolean data-type in SAS...
more
Sas Variables
04/12/19
How to read variable names in a SAS data set?
Are there any statements\\functions capable of get the name of variables?
Preferrably putting them into a column of another data set, a text field or a macro variable.
**E.g.**
**- Data set...
more
Sas
04/11/19
What does `.Z` mean in SAS?
Apologies for such an entirely uninformed question, but I don't know any SAS and just need to know what one line of code does, so I hope someone can help.
I have a loop over an array of variables,...
more
Sas
04/11/19
Is there a way to make SAS stop upon the first warning or error?
SAS likes to continue processing well after warnings and errors, so I often need to scroll back through pages in the log to find an issue. Is there a better way? I'd like it to stop as soon as the...
more
Sas No Response
04/04/19
SAS code stops running after submit, nothing in log either?
I am writing a SAS program which also uses some macros. However, SAS suddenly stopped running the codes that I submitted. If I select and submit a part of the code, I can see it copied in the log...
more
Sas Enterprise Guide
04/04/19
Tell SAS not to add newly generated tables on the Process Flow?
I have a SAS code that creates a lot of intermediary tables for my calculations. Thing is, I don't really care about this tables after the job is done, I only care to the finals results.
But,...
more
Sas
04/04/19
SAS - How to return a value from a SAS macro?
I would like to return a value from a SAS macro I created but I'm not sure how. The macro computes the number of observations in a dataset. I want the number of observations to be returned.
...
more
sas MACRO ampersand?
%let test = one;
%let one = two;
%put &test;
%put &&test;
%put &&&test;
%put &&&&test;
%put &&&&&test;
Well. I'm TOTALLY BEATEN...
more
Sas
03/27/19
In SAS, what does the option "dsd" stand for?
I have a quick question.
I am learning SAS and have come across the `dsd=` option.
Does anyone know what this stands for? It might assist in remembering / contextualizing.
Thanks.
sas date - convert today() into yyyymmdd format?
How do I convert a SAS date such as `"30JUL2009"d` into `YYYYMMDD` format (eg 20090730)?
So for instance:
data _null_;
format test ?????;
test=today();
put test=;
run;
Would give me...
more
Sas
03/26/19
How to detect how many observations in a dataset (or if it is empty), in SAS?
I wonder if there is a way of detecting whether a data set is empty, i.e. it has no observations.
Or in another saying, how to get the number of observations in a specific data set.
So that I can...
more
Sas
03/26/19
How can I make a character variable equal to the formatted value of a numeric variable for arbitrary SAS formats?
If I have a numeric variable with a format, is there a way to get the formatted value as a character variable?
e.g. I would like to write something like the following to print `10/06/2009` to the...
more
Sas
03/26/19
How to convert String to Date value in SAS?
I want to convert a String to Date in SAS, I tried:
data _null_;
monyy = '05May2013';
date = input(substr(strip(monyy),1,9),yymmdd.);;
put date=date9.;
run;
But it did not work. Can this...
more
Sas
03/26/19
reading next observation's value in current observation?
I've a dataset called 'input' with the following observations
ID Salary
10 1000
20 2000
30 3000
40 4000
I need an output dataset with following observations
ID Salary Next_row_Salary
10...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.