How to make good reproducible SAS examples? [closed] - sas

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
SAS programs are generally written in such a way that they are specific to a particular dataset. How can a SAS programmer create a reproducible example of SAS code, either to show a problem with their code to someone who does not have access to the original data, or to embed some data - whether real or artificial - in the example, so that someone else can easily run the same SAS program?

Reproducible examples in SAS are often possible without introducing any extra data, due to the existence of the SASHELP library.
This library contains numerous datasets that can be used as example data, including the commonly used SASHELP.CLASS and SASHELP.CARS datasets. These can be used to show simple examples of SAS code that either fit well with the data provided, or do not depend on the particulars of a dataset. They are available on all SAS installations.

The most direct way to produce a reproducible SAS example is to embed sample data using the datalines or cards statement.
data have;
input var1 var2 $;
datalines;
1 A
2 B
3 B
;;;;
run;
Some notes:
Datalines must be the last statement of the data step, immediately prior to run
If the datalines contain a semicolon, use datalines4 or cards4 and then terminate the block with four semicolons. Otherwise, one is sufficient.
Datalines may not be contained in a macro - they must be in open code
You may include a infile datalines; statement anywhere in the data step prior to the input statement, in order to modify the datalines to have a different delimiter than space, or use most other infile options.
In producing a reproducible example for a question on a forum such as this, it is best to include both have and want datasets (or otherwise clearly labelled datasets indicating the before-code and after-code).

Related

Major difference between SAS Studio and SAS Enterprise [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have been doing practices and exercising in SAS Studio for sometime. In addition to the fact that SAS Studio is free and better-looking, is there any other difference makes SAS Studio a better choice than SAS Enterprise?
Aside from HTML, running in the cloud, is there any functional difference? Or is there any specific task can be done with more efficiency with either platform?
There are several different implementations of SAS Studio, the On Demand version for Academics, the SAS University Edition as well as a version that companies can use to access their server. Each has different limitations. EG is more powerful in my opinion.
However, if they're both installed such that you're accessing a remote server they'll be more equivalent.
SAS UE is limited as well to the packages licensed, for example it does not support SAS Graph. Additionally, it runs on a VM which has limitations on what you can do. And most importantly - the licensing. SAS UE is designed primarily for learning. If you want to consult or implement in your workplace you'll need the full license and then can choose between EG and Studio.
The brand new FAQ also lists a few comparisons:
http://support.sas.com/software/products/sasstudio/faq/SASStudio_vsEG.htm
I agree that the SAS Studio interface is nice and clean but SAS EG has many features that are missing in SAS Studio. One very useful one for novices is the wizard that does proc tabulate code: Tasks > Describe > Summary Table

piping between D and Fortran [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I have previously asked a question, which is somewhat related to the present one, however, Please help a bit more.
As I understand it, from this link, I should be able to use redirect.stdin to a named pipe, then use a putc or binary write command to the pipe, and write unformatted data to it.
Nonetheless, I would love, that on the other end, a parallely running fortran process reads form one pipe, to which my D code writes in, and writes to another, from which i can read off, while in the D code.
Now problem is I don't find much information about named pipes in Fortran.
Before I use a C interface, to Fortran, is there any way to read pipes and write on a separate parallel pipe from Fortran?
EDIT: thanks for the hints, I sorted it.
I don't know much about Fortran but if you use the pipe redirection on the D side, the Fortran side just needs to use regular input read and output write functions, just like printing text to the screen, and it will be received on the D side.

How To Read data from Microsoft Excel File by C++ Program [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
now i have some massive data on Excel Sheet, and i need by c++ program to transform this data into text file, to use it later in another thing.
how can i accesses this Excel file, to get data from first attribute and put delimiter and so on??
I have personally used Microsoft Excel Automation to read from Excel in the applications I develop. Please check the link http://www.codeproject.com/Articles/15837/Accessing-Excel-Spreadsheets-via-C for more information on Excel Automation.
But it seems there are other options as discussed in the following links
http://www.codeproject.com/Articles/42504/ExcelFormat-Library
Read cells from Excel in C++?

Printing numbers column by column [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to print numbers column by column.
I am trying to run 50 simulations that will produce a list of numbers. For every simulation, the length of such list is unknown.
For every simulation I want to print the numbers down a column.
When the next simulation starts I want the program to go back up to the top of the file and start printing the list down without entering into the previous list.
All I can find are ways to print the numbers by row, but I will not know the numbers down the row unless I do all the simulations.
Any advice would be much appreciated!
You have a few choices:
Write each sim result to a separate file and collate later;
Hold all results in memory until finished;
After each simulation, read the existing file, and output it again with the new results added in;
Knowing the number of simulations you intend to produce, write results in binary and leave padding for those that are not yet done.
I would probably go with 1.
By "goes back to the top of the file", do you actually mean rewind the file pointer to access memory starting at the beginning of the file? I will assume that's what you meant. Since you want the first input after the last output, then you can run your simulations and print them in reverse order, or simply call the appropriate library functions as you need them.

Is SAS an acronym that stands for Statistical Analysis System or it's never an acronym? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I understand this is not a programming question.
I'm taking two courses with applications in SAS this semester, and I found out there was contradiction in each professor's interpretation of the name SAS. One of them said SAS does not stand for anything, the other said it's Statistical Analysis System which is also on Wikipedia page of SAS. Though it does not matter much, it would satisfy my curiosity to know the answer.
For the software company and solutions provided by SAS Institute, Inc., SAS is not an acronym. It is a registered trademark for the company and has officially been referred to simply as SAS since 1976. The original software was known as the "Statistical Analysis System" and many people continue to refer to it this way. However, SAS is much more than just statistics software.
And FYI: there are several hundred different meanings for "SAS" as an acronym, from "San Antonio Shoe" to the UK's "Special Air Service".
EDIT: Here is a link to a one hour video recording of a presentation made by one of the original founders of SAS, Tony Barr. It's as much a history of computing as just for SAS.
Yes, SAS is originally acronym for Statistical Analysis System, although this is quite some time since it was used like that. In "modern age" of SAS, they're no longer referring to this.