Wednesday
Quentin
Super User
Member since
06-23-2011
- 3,774 Posts
- 2,553 Likes Given
- 321 Solutions
- 2,514 Likes Received
-
Latest posts by Quentin
Subject Views Posted 158 Thursday 99 Wednesday 122 Wednesday 174 Monday 261 Monday 412 a week ago 120 a week ago 489 a week ago 501 2 weeks ago 222 2 weeks ago -
Activity Feed for Quentin
- Got a Like for Re: Reset SAS without restarting SAS????. Thursday
- Posted Re: Reset SAS without restarting SAS???? on SAS Programming. Thursday
- Posted Re: SAS Connection to Duckdb? on SAS Data Management. Wednesday
- Posted Re: SAS Connection to Duckdb? on SAS Data Management. Wednesday
- Liked Re: SAS Noteboots within SAS Studio - Statut modifié en : Suggestion Under Review for VincentRejany. Tuesday
- Liked Re: SAS log cpu/real time display format for Kurt_Bremser. Tuesday
- Got a Like for Re: SAS log cpu/real time display format. Tuesday
- Got a Like for Re: SAS Format contents WITHOUT running a proc or datastep (ie pure macro). Monday
- Posted Re: how to find dx codes in SID HCUP on SAS Programming. Monday
- Posted Re: SAS log cpu/real time display format on Administration and Deployment. Monday
- Posted Re: SAS log cpu/real time display format on Administration and Deployment. a week ago
- Got a Like for Re: Script to format SQL code. a week ago
- Got a Like for Re: Michigan SAS User Group (MSUG) 2025 1-Day SAS Conference. a week ago
- Posted Re: Michigan SAS User Group (MSUG) 2025 1-Day SAS Conference on Upcoming Events. a week ago
- Posted Re: Script to format SQL code on SAS Programming. a week ago
- Liked Re: Michigan SAS User Group (MSUG) 2025 1-Day SAS Conference for nbrucken. a week ago
- Liked Re: What's the best book (or 2) to for a desk reference for producing publication-ready tables in SA for MattJans. 2 weeks ago
- Got a Like for Re: What's the best book (or 2) to for a desk reference for producing publication-ready tables in SA. 2 weeks ago
- Liked SAS Innovate discount offer & free advance copy of SAS for Dummies for Mary_Snyder. 2 weeks ago
- Liked Re: SAS Format contents WITHOUT running a proc or datastep (ie pure macro) for BrunoMueller. 2 weeks ago
-
Posts I Liked
Subject Likes Author Latest Post 4 2 2 2 5 -
My Liked Posts
Subject Likes Posted 1 Thursday 1 Monday 1 2 weeks ago 1 a week ago 1 a week ago
Thursday
1 Like
I think it's important to define the scope of the reset. To me, "resetting SAS" implies a fresh SAS session (empty work library, no user-created macro variables, no user librefs assigned, etc etc.) .
Are you really only interested in clearing the log window and results window?
... View more
Wednesday
Interesting. I’m pretty sure I heard rumors of it being on the roadmap for SAS 9. Will have to ask around the SAS 9 desk at innovate. : )
... View more
Wednesday
@VincentRejany wrote: SAS/ACCESS Interface to DuckDB is coming in our July release, 2025.07. You can also already use the ODBC or JDBC drivers
Do you know if SAS/ACCESS to DuckDB made it into 9.4M9?
... View more
Monday
It's very unlikely that you have variables names with a in them, like: I10_DX1 If you run PROC CONTENTS on your data and look at the list of variables, you see | characters there in the variable name?
... View more
Monday
1 Like
I suppose you could try to investigate this through simulation.
Since you already have the core logic in place to run a series of steps, and compare the actual run time to the sum of the reported run time, you could try running a program with 300,000 fast steps, and see how the times compare. Then try maybe 100 very slow steps, and see how the times compare. You also might get different results from running in interactive mode vs batch mode...
You could always ask tech support. Maybe someone will dig through the source code...
... View more
a week ago
@RANUSER_1337 wrote:
Ok thanks. Do you by chance have any knowledge concerning the rounding vs. truncation issue I mentioned?
I'm surprised milliseconds would matter. And if you want to measure a step with millisecond precision, you'd have to think about things that won't be measured (time to write the log message? time to send the results across the network if using a remote session, etc.)
That said, SAS was written by statisticians. I would think it's safe to assume that they would round the time values rather than truncate them.
... View more
a week ago
1 Like
Great meeting content! And that's awesome that the pre- and post- conference training is hybrid.
... View more
a week ago
1 Like
I like the Python idea.
And <advertisement> you cold use PROC FCMP to call Python functions, so you can still run it from SAS. If you're curious to see PROC FCMP -> Python in action, BASUG's free webinar on Wed April 23 will feature Troy M. Hughes, the man who wrote the book on PROC FCMP, showing this approach. Register at: https://www.basug.org/events </advertisement>
... View more
2 weeks ago
2 Likes
Any chance your SAS program does not have a .sas extension? In Display Manager (PC SAS), if I use File-> Open Program to open myprogram.txt it will not syntax highlight it.
... View more
2 weeks ago
When you say some of the datasets are empty, you mean some of them have 0 records? That should not stop your dataset work.ALL from being created.
... View more
2 weeks ago
1 Like
Agree with Bruno's suggestion to consider using DOSUBL when you want to write a function-style macro with pure macro code, but want to execute DATA steps or PROC steps. For an introduction to the magic of DOSUBL, the best starting point is Rick Langston's original paper: https://support.sas.com/resources/papers/proceedings13/032-2013.pdf.
Since you mention FCMP and run_macro, you might also be interested in earlier papers by Secosky https://support.sas.com/resources/papers/proceedings12/227-2012.pdf and Rhoads https://www.lexjansen.com/nesug/nesug12/bb/bb14.pdf
... View more
2 weeks ago
Nice tip, thanks for sharing.
It looks like the value set my the MISSING statement is likely shared between the main session and the DOSUBL side session. If you change the value in the side session, the changed value is also seen in the main session.
Which is different than (most?) system options, which I think typically the side session will inherit the value of system options from the main session, but side session options seem to be independent of the main session options, and changes made to side session options do not typically propagate back to the main session (from my limited testing).
missing A B C ;
options firstobs=3 ;
%put main session missing: %missing();
%put main session firstobs: %sysfunc(getoption(firstobs));
data _null_ ;
rc=dosubl(
'
%put side session missing before assignment: %missing();
%put side session firstobs before assignment: %sysfunc(getoption(firstobs));
missing D E F;
options firstobs=9 ;
%put side session missing after assignment: %missing();
%put side session firstobs after assignment: %sysfunc(getoption(firstobs));
'
) ;
run ;
%put main session missing: %missing();
%put side session firstobs: %sysfunc(getoption(firstobs));
Returns:
main session missing: ABC
main session firstobs: 3
side session missing before assignment: ABC
side session firstobs before assignment: 3
side session missing after assignment: DEF
side session firstobs after assignment: 9
main session missing: DEF /*missing value was changed in main session*/
side session firstobs: 3 /*firstobs option was NOT changed in main session*/
... View more
2 weeks ago
If the value of &mynote is a lon string of letters and numbers without quotation marks around them, then you don't want quotation marks around the value on your %IF statement. The macro language does not use quotation marks to indicate text values, because every value is a text value in the macro language. Similarly, you don't need quotation marks on your %PUT statements. Try:
%macro server;
%if &mynode = longstringofletters_numbers
%then
%put TEST Server;
%else
%put PROD Server;
%mend;
... View more
3 weeks ago
@TheEsotericPunk wrote:
Are you just asking if the included files might be missing a semicolon or something? If so, then no, they are not. They run just fine on their own with no warnings or errors.
One of the things that can occasionally make debugging in EG hard is that behind the scenes, in an effort to be helpful, after your code is submitted EG will add a magic string that will try to close any unmatched quotes for you.
In your original post you said that in a fresh EG session, if you run the code, you get "NOTE: Extraneous text on %END statement ignored." and the second file never even starts.
I assume that's a typo, and you mean %MEND statement?
I would start by fixing that. If there is an unmatched quote, that could explain both the extraneous text on the %mend statement (if SAS has ignored one of your %macro statements because it's hidden in an accidentally quoted string), and the second file "never starting."
The mantra of debugging in SAS is to start with the first error (or first note that should be thought of as an error).
... View more
3 weeks ago
The RETAIN approach you describe sounds reasonable to me. Have you tried it?
Please post the example data as a data step reading in the data with CARDS statement, and please post the coded you have tried. And please describe whether the code you tried is giving you errors, or just incorrect results.
Posting the data and the code you have tried will help others help you.
BTW, if you don't want the contemporaneous HYPERTENSION variable to impact HT_LOOKBACK (i.e. you only want to consider preceding observations, then just reorder two statements, so that you would have:
ht_lookback= (visitdate<=cutoff_date) ;
if hypertension=1 then cutoff_date = intnx('year',visitdate,1,'same') ;
... View more