Recently in the SAS Community Library: Your often contains the information you need, but not sequenced in the order required for processing. @SASJedi shows you how to properly sequence data so you can compare the data in one table to the data in another, conduct merges or joins and more.
Hey SAS Community, I am new to SAS and would appreciate any advice on this topic. For a university project, I need to calculate the expected sales value for the upcoming months after my dataset runs out. The dataset includes Total_amt , which contains the transaction values, and Tran_date , which specifies the dates of the transactions. data TransactionsWithSasDate;
set Transactions;
Tran_date = mdy(Month, Day, Year);
format Tran_date date9.;
run;
proc sql;
create table MonthlySales as
select
intnx('Month', Tran_date, 0, 'Beginning') as Month format=date9.,
sum(Total_amt) as MonthlySalesValue
from TransactionsWithSasDate
group by calculated Month;
quit;
proc arima data=MonthlySales;
identify var=MonthlySalesValue(12);
estimate p=1 q=1;
forecast lead=12 id=Month interval=Month out=ForecastedSalesValue;
run;
proc sgplot data=ForecastedSalesValue;
series x=Month y=MonthlySalesValue / lineattrs=(color=blue) legendlabel="Actual";
series x=Month y=Forecast / lineattrs=(color=red) legendlabel="Forecast";
xaxis label='Month';
yaxis label='Monthly sales value';
title 'Monthly Sales Trend and Forecast';
run; I double-checked my code, but I am not sure if it is correct because the output graph looks a little off. Any advice on this topic would be highly appreciated! Greetings, Johannes
... View more
Hi Everyone,
I am getting below error message when trying to run below code with ENCODING=WLATIN1 from SAS Studio. Can you please suggest on it.
Note : The same code is running fine with ENCODING=UTF-8
DATA T1; var1="aábcčdď"; run;
... View more
Hi,
I'm currently waiting to get access for sas viya but I have a test case scenario to compare between sas eg and sas viya and just want to verify the sas viya code. For bootstrapping in sas eg I have this code
proc surveyselect data=data
out=BootSamples noprint
seed=25
reps=2000
method=urs
samprate=1
outhits;
run;
Am I right that this would be the equivalent code in sas viya or am i missing something?
/* Start CAS session and load data into CAS */
cas mysess sessopts=(caslib='casuser');
libname mylib cas sessref=mysess;
/* Load example data */
proc casutil;
load data=data casout="sample" replace;
run;
/* Perform bootstrap resampling using the sampling action set */
proc cas;
action sampling.srs result=r /
table={caslib='casuser', name='sample'}
output={casout={caslib='casuser', name='BootSamples', replace=true}}
samppct=100 /* Sampling rate of 100% for bootstrap */
method='URS' /* Unrestricted random sampling with replacement */
seed=25 /* Seed for reproducibility */
reps=2000; /* Number of bootstrap replicates */
selection={name='Freq', includeFreq=true}; /* Include frequency counts in the output */
quit;
/* Fetch and display some of the bootstrap samples (Optional) */
proc cas;
table.fetch / table={caslib='casuser', name='BootSamples'} to=10;
quit;
/* End CAS session */
cas mysess terminate;
... View more
Hi there, was hoping for some guidance on this. I'm a student, I'm taking a class on SAS this semester and I have access to SAS OnDemand for Academics. My problem is, I have a long road trip coming up, which will involve many hours in the car away from all internet connection. Mobile hotspot is not an option for me, as it's not part of my data plan. I'm going to need to do homework during this time. Is there a way that I can access the software offline? Would I be able to download it and just have my datasets kept on my computer, so I wouldn't need the cloud storage? Or does this version of SAS have an offline browser mode I might be able to use?
... View more
Boa tarde, tenho duas tabelas e gostaria de gerar/exportar um arquivo único, em que, cada tabela ficasse em uma aba do excel. Como fazer este procedimento?
... View more