02-22-2024
LNEW
Obsidian | Level 7
Member since
06-22-2015
- 27 Posts
- 21 Likes Given
- 1 Solutions
- 12 Likes Received
-
Latest posts by LNEW
Subject Views Posted 876 04-06-2021 12:44 PM 924 04-06-2021 10:33 AM 6206 04-18-2019 02:43 PM 8644 04-17-2019 01:58 PM 11400 04-16-2019 03:42 PM 3441 04-11-2019 04:50 PM 3447 04-11-2019 04:31 PM 3451 04-11-2019 04:03 PM 3467 04-11-2019 02:20 PM 1684 04-11-2019 01:56 PM -
Activity Feed for LNEW
- Posted Re: Hash Table Subsetting Question on SAS Programming. 04-06-2021 12:44 PM
- Posted Hash Table Subsetting Question on SAS Programming. 04-06-2021 10:33 AM
- Got a Like for Re: Early Weather Forecast for SASGF 19 in Dalla. 04-24-2019 07:45 AM
- Got a Like for Re: Early Weather Forecast for SASGF 19 in Dalla. 04-24-2019 06:20 AM
- Posted Re: Early Weather Forecast for SASGF 19 in Dalla on SAS Global Forum 2019. 04-24-2019 05:43 AM
- Liked Re: Early Weather Forecast for SASGF 19 in Dalla for CJac73. 04-24-2019 05:41 AM
- Posted Re: Early Weather Forecast for SASGF 19 in Dalla on SAS Global Forum 2019. 04-23-2019 09:32 AM
- Liked Re: Early Weather Forecast for SASGF 19 in Dalla for PabloNogueras. 04-23-2019 09:31 AM
- Got a Like for Re: Everybody needs Career Development. 04-22-2019 10:07 PM
- Got a Like for Re: Everybody needs Career Development. 04-22-2019 03:08 PM
- Got a Like for Re: Everybody needs Career Development. 04-22-2019 11:15 AM
- Got a Like for Re: Everybody needs Career Development. 04-22-2019 11:12 AM
- Posted Re: Everybody needs Career Development on SAS Global Forum 2019. 04-22-2019 09:57 AM
- Got a Like for Re: How to get a fast, helpful answer to your SAS questions. 04-22-2019 08:51 AM
- Liked Is there an orientation for first timers during the conference? for Banoo. 04-19-2019 06:08 PM
- Posted Re: Early Weather Forecast for SASGF 19 in Dalla on SAS Global Forum 2019. 04-18-2019 02:55 PM
- Got a Like for Re: You TOO can earn communities swag! Here’s how. 04-18-2019 02:50 PM
- Posted Re: You TOO can earn communities swag! Here’s how on SAS Global Forum 2019. 04-18-2019 02:46 PM
- Posted Re: How to get a fast, helpful answer to your SAS questions on New SAS User. 04-18-2019 02:43 PM
- Liked How to get a fast, helpful answer to your SAS questions for BeverlyBrown. 04-18-2019 02:42 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 3 1 7 2 -
My Liked Posts
Subject Likes Posted 2 04-24-2019 05:43 AM 4 04-22-2019 09:57 AM 1 04-18-2019 02:43 PM 1 04-18-2019 02:46 PM 1 04-18-2019 02:15 PM
04-06-2021
12:44 PM
Our client requested datasets of each school. I have exported the data from REDCap into SAS. I was able to find my way ... and now have good results. DATA _NULL_; if _n_ = 1 then do; if 0 then set redcap2; declare hash eachschool (dataset: 'redcap2(obs = 0)' , multidata: 'y'); eachschool.definekey (all: 'yes'); eachschool.definedata (all: 'YES'); eachschool.definedone (); end; do until (last.pc); set redcap2; by pc cn; eachschool.add(); end; eachschool.output (dataset: compress ('PCSample'||pc)); eachschool.clear(); run;
... View more
04-06-2021
10:33 AM
I have a data set with a survey_identifier (school/class) which looks like 1_1_ for school 1, class 1 in which there will be many students. And I will have numerous schools with many class numbers. So for instance I will have 25 rows with 1_1_ because 25 students will be in that class. I am trying to use a Hash procedure to create separate data sets for each school but am getting an error "Uninitialized object at line 1030 column 16." Can someone help me figure out the issue. I have DATA _NULL_; declare hash eachschool (dataset: 'redcap1', ordered: 'Y'); eachschool.definekey ('redcap_survey_identifier', 'cn'); eachschool.definedata (all: 'YES'); eachschool.definedone (); declare hiter heach ('eachschool'); declare hash hashnum; do until (done); set redcap1 end = done; if eachschool.check () then do; hashnum = _new_ hash (ordered: "Y"); hashnum.definekey ('redcap_survey_identifier', 'cn'); hashnum.definedata (all: "YES"); hashnum.definedone (); rc = eachschool.replace(); end; rc=eachschool.find(); rc=hashnum.replace(); /*THIS IS THE LINE GIVING ME THE ERROR*/ end; do while (heach.next() = 0); rc= hashnum.output (dataset: "school"||redcap_survey_identifier); end; stop; run;
... View more
04-18-2019
02:43 PM
1 Like
Thanks, I have bookmarked this page.
... View more
04-17-2019
01:58 PM
Here's a thought: Proc sql; create table first_set_only as select var1, var2 from dsn1 where id in (select id from work.ids); quit; %let set_list = dsn2 dsn3...dsn60; %macro app; do i = 1 %to 59; Proc sql; create table &set_list._1 as select var1, var2 from &set_list where id in (select id from work.ids); quit; proc append base = first_set_only data = &set_list._1 force; proc append base = first_set_only data = &set_list._1 force; proc append base = first_set_only date = &set_list._1 force; %end; %mend; %app;
... View more
04-11-2019
04:31 PM
try this instead in the proc sort before the proc report statement. proc sort data = salesbyproductbydate out = salesbyproductbydate_2; by year sales; run; reference new dataset salesbyproductbydate_2 your month refers to date. It does not refer to low to high amounts this too could be part of the issue.
... View more
04-11-2019
04:03 PM
I think sorting before using the report would work. Then reference the new report name. Let me know if this works. data salesbyproductbydate; set salesbyproductbydate; year = YEAR(date); month = Month(date); run; proc sort data = salesbyproductbydate out = salesbyproductbydate_1; by year descending sales; run;
... View more
04-11-2019
02:20 PM
1 Like
"descending" should go in before sales in your proc sort statement. PROC SORT DATA=data; by descending sales ; RUN;
... View more
04-11-2019
01:56 PM
With proc format you would have a repeated or overlap of values for 0. The simplest way I saw from using your information was creating a dataset with a category variable. data val; input LDH; datalines; 56 25 0 0 ; run; data val1; length Category $15; set val; if LDH >25 then do; Category = "LDH Normal"; end; if LDH = 25 then do; Category = "LDH > 1XNormal"; end; if LDH = 0 then do; Category = "LDH > 2XNorma"; end; if LDH = 0 then do; Category = "LDH > 3XNormal"; end; run;
... View more
04-11-2019
12:19 PM
You could try using the lag function: datebefore = lag(date);
... View more
09-01-2017
08:01 AM
This is what I ran and the results were spot on. Thank you. ods path sashelp.tmplmst(read) sasuser.templat(update); ods path sashelp.tmplmst(read); proc datasets library=sasuser nolist; delete templat(memtype=itemstor); run; ods path sasuser.templat(update) sashelp.tmplmst(read); proc template; list base.freq.onewayfreqs; quit;
... View more
09-01-2017
08:00 AM
Thanks so much. This is what I ran and the results were spot on. ods path sashelp.tmplmst(read) sasuser.templat(update); ods path sashelp.tmplmst(read); proc datasets library=sasuser nolist; delete templat(memtype=itemstor); run; ods path sasuser.templat(update) sashelp.tmplmst(read); proc template; list base.freq.onewayfreqs; quit;
... View more
08-31-2017
05:09 PM
ODS RTF FILE = 'S:\blahblah\frequencies.RTF'
STYLE = BARRETTSBLUE STARTPAGE = NO;
ODS NOPROCTITLE;
%MACRO PRINTFREQ (VAR = );
PROC FREQ DATA =dat._3_subset;
TABLES &VAR.;
WHERE &VAR. NOT IN ('7', '8', '9', '77', '88', '99');
RUN;
%MEND PRINTFREQ;
%PRINTFREQ (VAR=Q1)
%PRINTFREQ (VAR=Q2)
%PRINTFREQ (VAR=Q3) I am using 9.4 X64_7PRO platform X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation As you can see in the attachment my output has two percent columns. Can someone tell me why I am getting two percent columns in the output and also why I am not getting a decimal in the percent column? Is it a settings issue? Can you assist me in resetting if needed? Thanks. L
... View more