09-01-2015
DLing
Obsidian | Level 7
Member since
06-23-2011
- 104 Posts
- 12 Likes Given
- 0 Solutions
- 30 Likes Received
-
Latest posts by DLing
Subject Views Posted 34428 10-28-2011 03:37 PM 1952 10-28-2011 09:14 AM 2578 10-18-2011 09:50 AM 2623 10-11-2011 03:35 PM 2587 10-11-2011 01:46 PM 2978 10-11-2011 11:49 AM 1492 10-04-2011 04:46 PM 1944 10-04-2011 04:08 PM 18611 10-03-2011 04:17 PM 1639 10-03-2011 04:04 PM -
Activity Feed for DLing
- Got a Like for Re: Removing string from another string. 07-07-2021 06:31 PM
- Got a Like for Re: Removing string from another string. 03-16-2019 02:34 PM
- Got a Like for Re: Compare values across multiple variables. 07-03-2018 03:39 PM
- Got a Like for DMS Process. 03-07-2018 05:35 AM
- Got a Like for Weight statement - need confirmation of understanding. 09-01-2015 04:24 AM
- Got a Like for Re: simulation with two normal distributions. 09-01-2015 04:24 AM
- Got a Like for Re: Generating ID but don't want to have an id for blank value rows. 09-01-2015 04:24 AM
- Got a Like for Re: Problem with time() function. 09-01-2015 04:24 AM
- Got a Like for Poor model fit with binary logistic regression. 09-01-2015 04:24 AM
- Got a Like for Re: Looping through passing parameters. 09-01-2015 04:24 AM
- Got a Like for assigning random binary variables to data set in a predetermined mixture. 09-01-2015 04:24 AM
- Got a Like for Collapsing Dates. 07-30-2012 10:47 AM
- Posted Re: Compare values across multiple variables on SAS Programming. 10-28-2011 03:37 PM
- Posted Re: Use Previous Observation Values to Calculate Current Observation on SAS Programming. 10-28-2011 09:14 AM
- Posted We NEED an editable FAQ on SAS Programming. 10-18-2011 09:50 AM
- Posted Re: We NEED an editable FAQ on SAS Programming. 10-11-2011 03:35 PM
- Liked We NEED an editable FAQ for art297. 10-11-2011 03:26 PM
- Posted How can one correctly input big and little endian hex representations? on SAS Programming. 10-11-2011 01:46 PM
- Posted Re: How can one correctly input big and little endian hex representations? on SAS Programming. 10-11-2011 11:49 AM
- Posted Macro Question on SAS Programming. 10-04-2011 04:46 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 2 1 2 1 -
My Liked Posts
Subject Likes Posted 2 08-13-2009 10:08 AM 1 10-28-2011 03:37 PM 1 07-05-2011 10:51 AM 4 09-15-2011 03:00 PM 3 09-19-2011 03:02 PM
10-28-2011
03:37 PM
1 Like
Simple idea: test if the range is 0 or not. If it is 0, then all non-missing values are the same. If not, there is spread amongst the values. Try this: data same different; set have; if range(of v1-v5) = 0 then output same; else output different; run; Note that if there are missing values in the arguments, this WON'T detect its presence. You'll need additional logic to handle. Message was edited by: Daymond Ling
... View more
10-28-2011
09:14 AM
How about this? data data2; set data1; retain atrisk; if _n_ = 1 then atrisk = &atrisk; else atrisk = atrisk - censored - lag( event ); run;
... View more
10-18-2011
09:50 AM
My time is rather limited, but I am willing to help out on occasion.
... View more
10-11-2011
03:35 PM
Slightly different from the rules of how to post, I would really like to see people search for question and answers before they feel the need to post a question yet again. Perhaps this should be the first rule in the FAQ (search before post). WIthin the relatively short period of time I've been here, I have noticed many re-posts of essentially the same question by different people, thus a well managed FAQ section would go a long ways to helping new people find answers/content, and freeing up contributors to work on new questions instead of re-hashing the same answer to the same questions over and over and over...
... View more
10-11-2011
01:46 PM
Dealing with endian-ness is no fun, actually it's a royal pain in the rear. We have IBM mainframes, Solaris UNIX mid-range servers and Intel PC's. You need to know the endian of the data as well as the endian of the machine you are running on to pick the right formats/informats. Most people (rightly so) don't want to care about how machines store numbers. Those that grew up accessing databases never had to worry about data representation and are shocked that this is even necessary.
... View more
10-11-2011
11:49 AM
I ran the above code on Intel PC, Win XP, SAS 9.1.3, and both x and y are 23. I think on Intel machines, SAS informat of pib4. (native format) and pibr4. (intel format) are the same so x and y have the same value. If i use s370fpib2. this switches to a different endian from the Intel PC, and generates 5888.
... View more
10-04-2011
04:46 PM
There's not enough information to help you yet. Can you turn on macro diagnostics like: options mprint macrogen; ahead of your macro, submit, and post the log please.
... View more
10-04-2011
04:08 PM
1) Since the dataset is sorted, using first.indvid and last.indvid is easier and cleaner than using lag(). 2) the total variable needs to be retained across observations via "retain total;" or using the "a + b;" sum statement. You're probably looking for something like: data claims2 claimsmth1; set claims1; by indvid yrmth; output claims2; /* replication of claims1 */ if first.indvid then total = 0; total = total + paid; retain total 0; /* or you can use "total + paid;" which has an implied retain */ if total>=100 then output claimsmth1; run;
... View more
10-03-2011
04:17 PM
*.sas7bitm are SAS item store files used to store various things under SAS's management like registry, ODS graphics, PDF files... etc. They are not SAS datasets that store data. If you have SAS datasets, usually one uses SAS to export them to different formats like CSV, Excel. Why do you not want to use SAS to export things? I'm not aware of general utilities that convert SAS datasets, though there are other statistics software packages that can import SAS datasets into their environment.
... View more
10-03-2011
04:04 PM
1 Like
Rapid Predictive Miner, if I understand it correctly, is meant to simplify the model building process by using pre-defined modeling process flow diagrams. If you have relatively standard problems that RPM process flow can solve well, then it lets you very quickly run some models and see some results. If you need to tweak the process flow or do something fancier, then you need to drop into Enterprise Miner where you drive the entire modeling process, including putting together the process flow the way you want. I think of it as auto-pilot/cruise control versus taking the wheel yourself. There are times when you'd want one or the other, and the flexibility is there. RPM isn't necessarily leaving anything out per se.
... View more
10-03-2011
10:32 AM
3 Likes
I think what Rick is saying is that time() is just a 24 hour clock value, and doesn't handle the clock advancing to the next day, hence your getting negative values. The datetime() function does include date and time together so it should give you the corrrect result. For example, if your job started at 8pm and finished next day at 7pm, you want 23 hours, but time of 8pm minus time of 7pm, to SAS, is -1 hours, i.e., 1 hour before. TIme() has no notion of days.
... View more
09-29-2011
04:16 PM
proc summary data=sasuser.marchflights missing; *--- missing option outputs missing class values as well; class date; *--- you can attach formats to dates to get monthly, qtrly summaries easily; var x1 x2 x3; output out=mtsudat.marchflightsummary(drop=_:) /* drop _type_ _freq_ */ sum=x1sum x2sum x3sum n=x1n x2n x3n std(x1)=x1std ; run; proc summary by default prints nothing, so maxdec=2 has no effect, nor does the mean option. They are meaningful for PROC MEANS printed output.
... View more
09-29-2011
03:45 PM
PC SAS 9.1.3, no SAS/OR (otherwise PROC CLP constraint programming would be fun to play with in addition to PROC OPTMODEL). Can't vouch for efficiency, but it works. %let r1= 100; %let r2= 316; data soln(keep=c1-c3 dUsedOnce); do i = &r1 to &r2; *--- generate combinations; c1 = put( i*i, z5. ); do j = i+1 to &r2; c2 = put( j*j, z5. ); do k = j+1 to &r2; *--- using i+1 and j+1 generates lower triangular only; c3 = put( k*k, z5. ); link Chkit; *--- check this combination; end; end; end; return; Chkit: length c1-c3 $ 5 str15 $ 15; array digit[10] $ d1-d10 ('1','2','3','4','5','6','7','8','9','0'); array used[10] u1-u10; array freq[10] f1-f10; str15 = cat( c1, c2, c3 ); do d = 1 to 10; *--- calc freq and used indicator; freq = countc( str15, digit ); used = ( freq > 0 ); if freq = 1 then dUsedOnce = digit ; end; if sum(of used ) ~= 5 then return; *--- use 5 different digits; do d = 1 to 10; if used then do; *--- if d is used; if freq = d then return; *--- not used its own # of times; if used[freq ] = 0 then return; *--- freq is used; do p = 1 to d-1; *--- if p is used, must be different # of times; if used > 0 then if freq = freq then return; end; end; end; output; return; run; proc sql; select * from soln group by dUsedOnce having count(*)=1; quit; Hats off to PROC FCMP, very nice approach. Never used it, so I learned something valuable out of this.:smileygrin: Message was edited by: DLing (minor cleanup)
... View more
09-29-2011
09:28 AM
You're not being dense, you raised a very good point. You got me on that one, I don't understand why SAS did it that way. As you said, multiple attrib statements, last one wins, no compile time messages generated. But a redundant declare hash that is syntactically identical does generate an error message. Perhaps ask SAS to "fix" it, or help us understand the situations where multiple declare hash would causes issues. Message was edited by: DLing to fix grammar.
... View more
09-26-2011
01:54 PM
For Windows PC, WORK usually uses the local hard drive as opposed to LAN or other network storage. You can point them anywhere you like as long as you have read/write access. In UNIX environments, it is not uncommon to see a central directory and/or filesystem that's built for speed only being used for WORK. Since these SAS datasets only last for the duration of a SAS job, there's no need for mirroring or stripping.
... View more