Statistical Analysis System (SAS)

127

Solutions

142

Contributors

The Statistical Analysis System (SAS) programs consist of two steps, the DATA step and the PROC step. The DATA step reads data and prepares it for use by subsequent DATA or PROC steps. A SAS procedure (PROC) is a collection of statements that execute a certain task. SAS procedures have their own statements and commands, but many are shared among procedures. JMP is the graphical user interface for SAS, and is used in applications such as Six Sigma, quality control and engineering, design of experiments and scientific research.

Share tech news, updates, or what's on your mind.

Sign up to Post

Experts,

This is a SAS question.

I have a column that is defined as a date field that I populated with '01JAN1900 'd just so I could create tables with the same datatype that I concatenated with a union.  

I would like to move spaces to this column.  Is there a way I can do this.

I have the same issue with a numeric column that now has '0' in it  I would like to move spaces to it also.
0
Rowby Goren Makes an Impact on Screen and Online
LVL 13
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

I want to merge 12 historical datasets from a library (each named FINAL_201812, FINAL_201901, FINAL_201902, etc.) and the current dataset FINAL_201908 into one dataset.  Each dataset has the same amount of columns and column names.  For each of the lines of data within the dataset I want to add a new column in the first position that designates what dataset it came from (so each file has 15 specific locations...so my final dataset with ALL 13 datasets should have a new column with the dataset name:
dataset_name                      location                             field3                            field4                                 field5
FINAL_201812                      Dallas                                 Item1                           Item2                                  Item3
FINAL_201812                      Pittsburgh                         Item1                           Item2                                  Item3
FINAL_201901                      Dallas                                 Item1                           Item2                                  Item3
FINAL_201901                      Pittsburgh                         Item1                           Item2                                  Item3

libname sasdata "mydirectorypath";

dataset names, Final_201808.sas7bdat, Final_201809.sas7bdat, ... Final_201908.sas7bdat
0
I'm stumbling here.  I have a SAS program that creates a final dataset and I use an ods excel proc report that creates a formatted spreadsheet.  I also have 11 other sas datasets under a libname in which I need to get added to this single excel file as well.  Now I understand the limitations of ods excel not being able to create separate sheets easily into one file.  

What I'm struggling with is how to do this, whether I need to loop through the historical datasets in one single ods statement that creates these datasets on separate tabs or what.

/* so my libname statement is */
libname sasdata "mypath" access=readonly';

/* Then I have my macro at the end to create the excel file: */
%macro createReport(utildt);

options missing=' ';
ODS LISTING CLOSE;

ODS PATH (prepend) STD.template99(READ) SASHELP.TEMPLMST(READ);
ODS ESCAPECHAR='^';

TITLE;

ods excel file = " &rptpath./&filenm..xlsx" style=stdXLSX

/* CRITERIA PAGE - first sheet; specifies criteria for report */

options (orientation='portrait'
                   sheet_name=Criteria"
                           );

proc report data=CritReport no windwos headline headskip spacing = 2 missing split='|';

column description;

define description /display "REPORT DESCRIPTION;

run;

/* REPORT SHEET - second sheet; actual report data in a formatted sheet */

TITLE;

ods excel style =stdXLSX
options (orientation='portrait'
                   sheet_name=&utildt."
                    );
proc report data=FINAL_&utildt. 

Open in new window

0
Hi everyone,

in SAS I am trying to sort one SAS dataset by a certain variable (var1) and then write all records to SAS datasets (name includes "var1") and ASCII files (name includes "var1"). I am thinking to do everything in two steps as below but I am not sure if Step 2 should be done in PROC SQL or maybe in a DATA step with macros?  If anyone knows how to do Step 2 please let me know. Any suggestions or examples would be greatly appriciated.  

Step 1. Sort olddata.sas7bdat SAS dataset by var1
Step 2. Write all records from olddata.sas7bdat for each unique var1 to its correcponding data<var1>.sas7bdat SAS datasets and data<var1>.in ASCII files

*********************
* Step 1- sorting initial dataset
***********************
proc sort data=olddata;
   by var1;
run;

****************************
* Step 2 - creating data<var1>.sas7bdat
****************************
proc sql noprint;
  select distinct var1 into : x separated by ' ' from olddata;
quit;
%macro create;
  %do i = 1 %to %eval(%sysfunc(count(&x, %str( )))+1);
  data data%scan(&x,&i.);
  set olddata;
  if var1 = "%scan(&x,&i.)";
  run;
  %end;
%mend;
%create

Open in new window

0
Using 0 as a baseline, I am looking to conduct a t-test. In fact, I want to perform a t-test on each of these 10 values. Here are the 10 values in list format. These 10 values correspond to standard deviation. However, I am not sure if I need more information than just the standard deviation to conduct the t-test.

list=[0.00330, 0.0022, 0.0018, 0.0016, 0.001, 0.0013, 0.0011, 0.00, 0.001, 0.0007]

So again, Before I do anything code related,I need to know if more components are required to conduct these t-tests in the manner in which I describe above. (These standard deviations were generated through a bootstrapping process, if it helps anything to know)


But, if I do not need to furnish any further information, I would appreciate any help in generating the code for the t-test.
0
Object oriented design is used to identify and define all program object that must work together.
0
I have created two sheets with date field, wrkorder no , hours and invoice count of technicians. One sheet shows day and other shows week numbers. The problem I’m facing is in the weeks sheet where even though the wrkorder happened twice in two dates the hours are adding up and sum of hours for each work order is showing. The total hours are accurate thought but invoicecount is getting wrong. Since a wrkorder happened in both days it is counted  as two but it showing me one.
0
Why Statistics is important for Data Analysis?
What is the role of Statistics in Data Analysis?

*Please share a real life example.*
0
Hello All Experts,
I am a student enthusiast in learning "Data Analytics" , which is the best platform to learn for FREE?
I want to Learn 'Data Science (Statistics)' & 'SAS/R' from scratch?
Any videos? Any websites? Any Blogs?

Thanks,

Regards,
Satish Kumar G N
0
The curve on the tab "Curve fitting graphic" in the Excel "Distansomräkningstider" attached here is almost perfect. It is only the last part that is pointing too sharply upwards. It should be more flattened out (but never turn townwards, always continue to pointing slightly upwards) from around 2500 metres or 2600 metres, which seems to be a "breaking point" for two different curves.

The context is harness racing track times for different lengths of the races with the purpose of calculating re-calulation coefficients for different lengths of the races. Index is 2140 metres (x). The software I use is CurveExpert. I received help here at EE earlier at this thread:

Is there any online tool where I can enter x and y values to get a curve diagram displayed, and then enter more x values to get exact y values calculated?

In essence, this graph consists of 2 curves, and they cross each other at around 2500 or 2600 metres. The first curve is more favouring the speed of the horse (shorter distance, which means the horse is able to run much faster due to a short distance where strength and stamina is not required), whereas the second curve is more favouring the strength, or stamina, of the horse (longer distance, which means the horse can not run so much faster the more the curve moves to the right and the distance gets longer and longer).

My reliable five values I have now are these:

x=1640; y=0.913999
x=2140; y=1
x=2640; y=1.048999
x=3140; y=1.110999
x=4000; …
0
I am trying to program an SAS drive for an MMORPG. The game will hook up to any television and will have an interactive board connected via Bluetooth to the game. Can anyone assist me in how to program the drive for this game?
0

Statistical Analysis System (SAS)

127

Solutions

142

Contributors

The Statistical Analysis System (SAS) programs consist of two steps, the DATA step and the PROC step. The DATA step reads data and prepares it for use by subsequent DATA or PROC steps. A SAS procedure (PROC) is a collection of statements that execute a certain task. SAS procedures have their own statements and commands, but many are shared among procedures. JMP is the graphical user interface for SAS, and is used in applications such as Six Sigma, quality control and engineering, design of experiments and scientific research.

Top Experts In
Statistical Analysis System (SAS)
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!