I was using proc tabulate, although it gave me the desired output but
- Firstly, the output ss below has some useless columns like _type_ , _page_, _table_ , which I don't want.
-Secondly, I want only 9th 10th and 11th January data only like the output I am getting as below ss with the total of frequency from 1JAN2023 to today.
In the below ss I only want 9JAN 10JAN and TOTAL(from 1JAN2023 till today).
So my question is How to remove 1JAN till 8JAN and still get the same total.
Could anyone help?
Ur contribution is appreciated. Thanks in advance.
Please provide data as working SAS data step code, which has been requested of you several times previously. We're trying to help you, but you have to help us.
data final2_1t;
set FINAL_DATE_DATA1t(keep=FIN_EMP_CODE VPA Status Emp_Code DATE_OF_APPROVAL);
run;
The above code is the data step which I am tabulating using proc tabulate.
We don't have those data sets.
We need (a portion of) your data as working SAS data step code. Example in this thread (scroll down): https://communities.sas.com/t5/SAS-Programming/Calculate-a-rolling-moving-sum/m-p/852135#M336854
Please see this link for more examples and a macro that can provide data properly.
https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/
If you are going to use Proc Tabulate to create data sets you will have to work within the confines of what the out= option provides. As mentioned in another of your posts you can use the data set option Drop to remove variables. However the variable you mention, such as _type_ and _table_ are used to indicate which total something may represent.
What you request might be possible with a custom multilabel format, might. Your output does not show any values of 01JAN2023 so it may not be possible to get a "total of frequency from 1JAN2023 to today. "
REALLY need input data example and the exact output expected.
An example with multilabel format.
data example; do date= '01Jan2023'd to today(); /* create different numbers of records for each date*/ do i=1 to rand('integer',10); output; end; end; format date date9.; run; proc format; value dategrp (multilabel notsorted) '01Jan2023'd - '11Jan2023'd='1 to 11 Jan' '09Jan2023'd ='09Jan2023' '10Jan2023'd ='10Jan2023' ; run; proc tabulate data=example; class date /mlf order=data; format date dategrp.; table date, n ; run;
Multilabel formats are only available in a very few procedures, Tabulate, Report, Means and Summary.
The order of definition and options in the Proc format code coupled with the options in Proc Tabulate may make getting a specific order of output a bit challenging.
You cannot use the function Today() in a simple range assignment for a Value range in Proc format. If you want such flexibility you may be able to use your source data to make a CNTLIN data set that would make a similar format definition. Again, might.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.