63 Answered Questions for the topic SAS

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

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

04/15/19

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

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

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

04/02/19

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 Format

03/26/19

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

What is the function of output statement in a SAS Program

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
Sas

03/26/19

SAS can I make sas process observations backwards?

I know that Sas starts with the observation at the top of a dataset when processing and proceeds to the next until it reaches the bottom observation, but is there an easy way to make sas process... more
Sas

03/19/19

SAS: concatenate different datasets while keeping the individual data table names?

I'm trying to concatenate multiple datasets in SAS, and I'm looking for a way to store information about individual dataset names in the final stacked dataset. For eg. initial data sets are... more
Sas

03/19/19

How to pad out character fields in SAS?

I am creating a SAS dataset from a database that includes a VARCHAR(5) key field. This field includes some entries that use all 5 characters and some that use fewer. When I import this data, I... more
Sas Exponent

03/19/19

SAS function for using 'power' / exponential?

I may be missing something obvious, but how do you calculate 'powers' in SAS? Eg X squared, or Y cubed? what I need is to have variable1 ^ variable2, but cannot find the syntax... (I am using... more
Sas

03/18/19

List only the column names of a dataset?

I am working on SAS in UNIX env and I want to view only the column name of a dataset. I have tried proc contents and proc print but both of them list a lot of other irrevelant information that I do... 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.