I have a character variable that I am trying to convert to SAS date format (mmddyy10.) This is the code I am using: data anzio_dados_fa;
set anzio_dados_fa
(rename=(DISCHARGE_DOC=DISCHARGE_DOCNUM));
DISCHARGE_DOC = input(DISCHARGE_DOCNUM, mmddyy10.);
drop DISCHARGE_DOCNUM;
run; However, when I do a proc contents and look at my variable, it seems to have only converted it to a number variable now. When I look at the "format" and "informat" columns after doing a PROC CONTENTS, these columns for my variable are just blank. How do I convert my variable to a date format? What am I doing wrong in my above code? Thanks in advance
... View more
Oh I see what you mean... so including for just "COMPREHENSIVE" should capture all variations that include that string? So for example, it should also capture "COMPREHENSIVE AX", "COMPREHENSIVE ASSESSMENT" AND "COMPREHENSIVE ASSESS"? I might have tried that before but I don't think it captured all variations (at least not with prxmatch) which is why I had to spell all variations out one by one. thanks for trying to help though!
... View more
Thanks for your response! I need to flag all values for the variable DESCRIPTION that contain "comprehensive assessment" BUT ALSO other variation of this like "comprehensive ax" + "comp ax" etc. Just including "Comprehensive Assessment" in my code doesn't capture the other variations of this. I need to do this b/c this is how we set up our rule for flagging-they all mean the same thing but have different values, which is why we are trying to flag them all the same. Is there a better way for me to accomplish this? The actual error that I am getting is the following: The quoted string currently being processed has become more than 262 characters long.
You might have unbalanced quotation marks. So I don't think it's actually processing the code that I posted above. which means that i can't ignore it.
... View more
Hi Everyone, New to SAS I am trying to flag all variables with the string "comprehensive assessment". This is part of my code: ca_only = 0;
if prxmatch ("m/Comprehensive Assessment|comprehensive ax|HW - Comprehensive Ax|FA - Comprehensive Ax|FA - Comprehensive Ax TM|HW - Comprehensive Ax TM|FA - Reassessment|HW - Reassessment|Reassessment|Dominance|Comp Ax Telemedicine|Clinic Comprehensive Assessment|Comprehensive Ax - Telemedicine|Comprehensive Ax - TM/oi", description)> 0 then
if prxmatch("m/Comprehensive Assessment - OT\/PT|Dominance Transfer Training|conc|psych|LIBYA - AX - COMPREHENSIVE ASSESSMENT|LIBYA - AX - COMPREHENSIVE ASSESSMENT OT\/PT|/oi", description) = 0 then ca_only = 1; However, I've reached a point now where it seems my code is too long and I am getting an error message saying I have exceeded 252 characters. How else can I find all values that CONTAIN "comprehensive assessment" but also contain other variations like outlined in my above code (e.g., "comprehensive ax", "comprehensive ax-tm", "comp ax") etc... thanks in advanced!
... View more
It is informative because it is THE EXACT SAME PROBLEM. I can defintiely start a new thread though and increase redundancy and duplication on this site.
... View more
I got it! just add n="you total title here" this is the code I used: proc print data=omrswork noobs n="site count=";
where count_carf1 >0 and count_carf2=0 and count_carf3=0 and count_carf4=0 and dc_fiscal_year=3 and dc_fiscal_year^=99;
var dc_fiscal_year count_nscx omrs_num_visits obs;
sum count_nscx denominator;
by site;
format dc_fiscal_year fiscalyear. site site.;
run;
... View more
The followin my proc print code. However, what is not displaying is the n value fo each of the sites (i.e., the number of observations). How can I get this value to display? proc print data=omrswork noobs n;
where count_carf1 >0 and count_carf2=0 and count_carf3=0 and count_carf4=0 and dc_fiscal_year=3 and dc_fiscal_year^=99;
var dc_fiscal_year count_nscx omrs_num_visits obs;
sum count_nscx denominator;
by site;
format dc_fiscal_year fiscalyear. site site.;
run;
... View more
I'm trying to format the mean as a percentage. this is the code I used: proc means data=omrswork;
where count_carf1 >0 and count_carf2=0 and count_carf3=0 and count_carf4=0 and dc_fiscal_year=2 and dc_fiscal_year^=99 and percent_nscx^=.;
var percent_nscx;
format dc_fiscal_year fiscalyear. percent_nscx percent8.2 site site.;
run; How come the percent.8.2 format isn't working for the actual mean that is calculated? When I run the proc means, the mean is still in decimal form.
... View more
awesome thank you. I was using that but forgot the "/" in my code! Here is my final line in my code: tables site*tsi_acc_rs_cat / norow nofreq nocol;
... View more
Really simple... I am running a bunch of proc freqs, but I need to make a million graphs and when I export the proc freqs to an excel it's not allowing me to unmerge the cells making it very tedious to create graphs quickly in excel. How do I remove the percent, row percent and col percent from my output? I only want to see frequency. thanks!
... View more
I have a variable that is in SAS date formate and I want to extract just the year from this into a new variable. I tried this code but I'm not sure what I'm doing wrong data orpwork;
tx_year=year(orp_tx_start);
run; How do I extract the year from my date variable into a new variable?
... View more
I have a variable that i created by subtracting one variable from another. I want to be able to view all negative values along with my two original values. How can I accomplish this? I know this is so easy but I haven't been able to find it online. I tried: proc print data=test;
var variable1=-;
run; I tried other variations of this as well.
... View more