hi,
i hate when small things in SAS bother me 🙂
so this is a part of my code:
proc sql noprint;
select count(*) into :rowcount1 from xx.secured;
quit;
data _null_;
SET xx.secured;
file "/aa/bbb/ccc/ddd/test.txt" dlm='|';
if _n_ = 1 then
put "&sysdate9.|&rowcount1.|&sysuserid.";
put (_all_)(~);
run;
then the header in my output file will show something like
29JUL2019| 2936|abcdr4
then i would change the select into query to
proc sql noprint;
select strip(put((count(*),6.)) into :rowcount1 from xx.secured;
quit;
and I get this 29JUL2019|2936 |abcdr4
but i need to get this 29JUL2019|2936|abcdr4.
also ,can i capitalize the sysuserid in the put statement?
Any one please?
Thanks,
T
Use Trimmed
proc sql noprint;
select count(*) into :rowcount1 Trimmed from xx.secured;
quit;
Use Trimmed
proc sql noprint;
select count(*) into :rowcount1 Trimmed from xx.secured;
quit;
thank you novinosrin!
and do you maybe know how I can capitalize the sysuserid with some changes in the put statement?
abcdr4 to ABCDR4
data _null_;
put "&sysdate9.|%upcase(&sysuserid.)";
put (_all_)(~);
run;
It's a simple %upcase function.
Hi @Tal Tell you what, this is when @Kurt_Bremser 's maxims is so handy. I have it printed in my desk. It directs beautifully to look where for what. Slick stuff and you should get that too
thank you again but how I get to this article of his. He got many 🙂
Find the link to what @novinosrin mentioned in my footnotes.
The SAS Global Forum paper is online at https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3062-2019.pdf
thank you 🙂
Btw, so this would fall into Maxim 9
Honestly, it's so eloquent and a time saver. I use the Maxim 5 as the last option. For my convenience, I have sorted the maxims in my printed paper as 5th one to me is 52 the last one. 🙂 coz no need in asking if I can find it. In essence Maxim 9 or Maxim 7 answers/guides this thread
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.