Kick-start Your Data Exploration Journey with SAS Information Catalog
Recent Library Articles
Recently in the SAS Community Library: @smanoj introduces you to the SAS Information Catalog, which provides a powerful search engine to find needed data assets.
Brand new to SAS. I'm doing something that I expect is relatively easy, but I'm struggling to get it right. The requirement is basic - I'm reading in a long file with many rows, if a record matches a criteria I want it to be shipped to a different "bypass" file that I'll work on in a later process, but it should be removed from the original read-in file. Environment is zOS - input file is defined and passed in via JCL (all working). I get the following errors if I remove my actual logic - if I leave the FILENAME statement in without referencing it there's no errors. ERROR: Invalid logical name. ERROR: Error in the FILENAME statement. ERROR: Invalid file, BYPASS_FILE. FILENAME BYPASS_FILE BYPASS1;
/***********************************************************/
/* READ FILE */
/***********************************************************/
DATA DATAIN;
INFILE DATAIN;
INPUT
@ 00001 RECORD_NUMBER $CHAR8.
@ 01769 COMPONENT_STATUS $CHAR1.
;
/*******************************************************************/
/* CREATE BYPASS FILE - USED TO STORE RECORDS WHICH HAVE AN */
/* INACTIVE COMPONENT: COMPONENT_STATUS = I */
/*******************************************************************/
IF COMPONENT_STATUS = 'I' THEN DO;
FILE BYPASS_FILE;
PUT;
DELETE;
END;
... View 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