03-02-2021
JerryLeBreton
Pyrite | Level 9
Member since
07-14-2013
- 88 Posts
- 1 Likes Given
- 7 Solutions
- 55 Likes Received
-
Latest posts by JerryLeBreton
Subject Views Posted 670 05-15-2018 03:08 AM 1770 04-26-2018 11:31 PM 1811 04-26-2018 07:03 PM 1531 12-11-2016 11:31 PM 1555 12-08-2016 10:22 PM 15144 05-24-2016 10:04 PM 2595 05-24-2016 07:51 PM 2274 05-24-2016 12:04 AM 2628 05-23-2016 09:12 PM 3204 05-23-2016 12:18 AM -
Activity Feed for JerryLeBreton
- Got a Like for Re: External HTML and Proc Stream, how to remove all streamDelim newline?. 09-23-2022 02:08 PM
- Got a Like for Re: can I display 2 proc tabs side by side?. 04-27-2021 10:15 AM
- Posted Stored Process not executing automatically in VA report on SAS Visual Analytics. 05-15-2018 03:08 AM
- Posted Re: Colouring proc tabulate columns by column classification value on SAS Programming. 04-26-2018 11:31 PM
- Posted Colouring proc tabulate columns by column classification value on SAS Programming. 04-26-2018 07:03 PM
- Got a Like for Re: how to combine multiple observations into one. 08-15-2017 04:54 PM
- Posted Re: Capturing, and displaying, Crosstab selection values on SAS Visual Analytics. 12-11-2016 11:31 PM
- Posted Capturing, and displaying, Crosstab selection values on SAS Visual Analytics. 12-08-2016 10:22 PM
- Got a Like for Re: Parsing CamelCase. 06-02-2016 01:53 PM
- Got a Like for Re: How to Merge Two Datasets with Different Variables, but ResponseIDs in Different Orders. 05-24-2016 10:10 PM
- Posted Re: How to Merge Two Datasets with Different Variables, but ResponseIDs in Different Orders on SAS Data Management. 05-24-2016 10:04 PM
- Posted Re: Parsing CamelCase on SAS Programming. 05-24-2016 07:51 PM
- Got a Like for Re: PROC TRANSPOSE with conditions. 05-24-2016 11:18 AM
- Posted Re: exclude records on SAS Programming. 05-24-2016 12:04 AM
- Got a Like for Re: Parsing CamelCase. 05-23-2016 09:17 PM
- Posted Re: Parsing CamelCase on SAS Programming. 05-23-2016 09:12 PM
- Liked Re: PROC TRANSPOSE with conditions for Tom. 05-23-2016 01:57 AM
- Got a Like for Re: PROC TRANSPOSE with conditions. 05-23-2016 12:21 AM
- Posted Re: PROC TRANSPOSE with conditions on SAS Programming. 05-23-2016 12:18 AM
- Got a Like for Re: How Do I Sum a column that is a calculated by two other columns. 05-18-2016 12:31 AM
-
Posts I Liked
Subject Likes Author Latest Post 3 -
My Liked Posts
Subject Likes Posted 1 12-10-2015 11:12 PM 1 12-07-2015 06:26 PM 1 11-25-2013 07:35 PM 1 05-24-2016 07:51 PM 2 05-24-2016 10:04 PM
08-06-2015
01:34 AM
3 Likes
And here's a solution using hash object - which would be more efficient. data want2; if _n_ = 0 then set have; declare hash h(dataset:'have(where=(unique_numbr is not missing))'); h.definekey('institution_name', 'id'); h.definedata('unique_numbr'); h.definedone(); do until (the_end); set have end=the_end; if unique_numbr = . then rc = h.find(); output; end; stop; drop rc; run;
... View more
08-06-2015
12:52 AM
Here is an SQL solution: proc sql ; create table want as select a.institution_name, a.id, b.unique_numbr, a.date from have a left join (select distinct institution_name, id, unique_numbr from have where unique_numbr is not missing) b on a.institution_name = b.institution_name and a.id = b.id;
... View more
08-03-2015
09:08 PM
4 Likes
Depending on what else you are doing, you could use Proc SORT, which performs about the same as Proc FREQ. proc sort data=master(keep=ID) nounikey out=duplicateIDs uniout=uniqueIDs ; by ID; run; And if you're not interested in the non-unique IDs being written to a data set, you can use... out = _null_
... View more
08-03-2015
08:26 PM
1 Like
Proc FREQ will do this much quicker. Try this: proc freq data=master noprint ; table ID / out=UniqueIDs(where=(count=1)); run;
... View more
07-31-2015
03:48 AM
3 Likes
Except I don't think ODS TEXT= is supported by ExcelXP. Maybe incorporate it into a TITLE.
... View more
07-24-2015
06:45 PM
Perfect!! Thanks Cynthia.
... View more
07-24-2015
08:22 AM
How can I create a report that provides a total for 1 column but not another? For example, I don't want the total of 7 below: This report should not total the org_count column because, while an organisation only exists in 1 region, it can receive amounts under different awards. So the total of org_count is double counting some orgs. So while I need to provide a total for the amount column, how can i suppress the total org_count? Here's the code for the above. TIA Jerry ----------------------------------------------------- data have; input org region $ award $ amount org_count; cards; 10 east A 200 1 10 east B 400 1 20 west B 500 1 30 west A 250 1 30 west B 100 1 40 east A 150 1 40 east B 100 1 ; run; proc report data=have; col region award org_count amount; define region / group ; define award / group ; define org_count / sum; define amount / sum ; rbreak after / summarize ; compute after; region='Total'; endcomp; run;
... View more
07-22-2015
03:33 AM
Maybe this: var4 = ^(var1=var2=var3); Sorry - missed the point. You want something like: var4 = (var1=var2=var3 ='Buffalo'); Your array processing would be fine too of course, and more generic.
... View more
07-22-2015
03:18 AM
Try: var4 = ^sum(of var1-var3); The ^ produces a Boolean result since any non-zero value is considered true.
... View more
12-13-2014
09:53 PM
1 Like
Ahhhhhh, indeed. Now, did you realise SAS day 20,000 (4Oct2014) is the anniversary of the launch of Sputnik 1 in 1957? And SAS day 10,000 (19May 1987) is the anniverary of the launch, in 1971, also by the USSR, of Mars 2 - the first man-made probe to reach the surface of Mars. So, by choosing 1Jan1960 as day zero, were the SAS founding fathers subtly celebrating the USSR's achievements in the space race? Just a thought.
... View more
09-05-2014
11:01 PM
Did you fix the %IF condition too? 43 %macro try/minoperator; 44 45 proc sql noprint; 46 select distinct max into: max_val separated by ' ' 47 from bin_table; 48 quit; 49 50 %if . in &max_val %then %do; 51 %put "ERROR:Missing value found"; 52 %end; 53 54 %mend try; 55 %try; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds "ERROR:Missing value found" 56 57 ; If you want variation within your preferred macro approach you can try this too: %macro try/minoperator; proc sql noprint; select count(*) into: max_val from bin_table where max is missing ; quit; %if &max_val %then %do; %put "ERROR:Missing value found"; %end; %mend try;
... View more
09-05-2014
07:49 PM
There are easier ways to achieve your objective but the code doesn't work because: 1. The condition should be %if . in &max_val 2. The delimiter should just be a space (otherwise if you want use a comma use %macro try/minoperator mindelimiter=','; )
... View more
11-25-2013
07:35 PM
1 Like
Try this... proc transpose data=have out=nearly prefix=x; by col1; var col2; run; data want; set nearly; col2 = catx(',', of x:); keep col1 col2; run; ... and repeat for the other way round.
... View more
11-22-2013
05:13 PM
A little array processing is one way to solve this... data want; set have; array Secs[5] sec1-sec5; length populated $10; do i = 1 to 5; if secs ne '' then populated = catx(',', populated, put(i,1.)); end; drop i; run;
... View more
- « Previous
- Next »