Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
Hello Everyone, I am facing an issue with SAS Viya user activity report as SAS Job to update CAS audit data keeps on failing in SAS Viya 4. I have different types of user IDs which authenticate to SAS Viya. Most of them are just numbers and few are only characters. I am able to list the data from CLI, but it fails when data is being uploaded to CAS table (from CSV) for reporting. NOTE: Active Session now server. {rowsDeleted=0} ERROR: The variable User ID has been specified with incompatible data types. as per my initial investigation, I suspect this is because of the GUSSINGROWS function of SAS import. so it only considers first 20 rows (default) to decide the data type of a column. So if there are only number IDs in first 20 rows, it decides the data type as "double", but as there can be character user IDs also, the data type should be varchar and then, it fails with above error. Is there a way to change this default value or anyone who has faced similar problem and was able to fix this?
... View more
Hi all,
Please help me to code this. This is the dataset below-
I have 2 drugs being used for each ID i.e., SGA and DM. I have multiple start date and end dates for each ID and drug. I want to see if the DM_start falls into any of the SGA_start and SGA_end under each id. That is DM_start of period 3 can fall in the SGA_start and SGA_end of period1.
And also calculate the number of overlapping days for each time period. I want to know the no. of days for each orange period.
Thank you all in advance,
Any help would be appreciated.
... View more
I'm having difficulty writing a piece of SAS code and I'm seeking the most effective approach within SAS. I have a variable named 'type' (with values 1, 2, 3, 4) and client IDs. Essentially, I aim to create another variable called 'modified_type,' which follows these rules: If there's a single unique client ID with only 1 in the 'type' variable, then 'modified_type' should be set to 0. However, if there are multiple client IDs with the same number having 1 in the 'type' variable, 'modified_type' should be set to 1. If there are 2 in the 'type' variable, then 'modified_type' should be set to 2... and so on. I tried using the retain function so something like this: retain modified_type 0; if first.client_id then modified_type = 0; if type = '1' or type = '1st' then modified_type = 1; else if type = '2' or = '2nd' then modified_type = 2; and so on..... but these does seem to retain 0 in the type and for some reason shows as 1. Yea im note sure the best way to do this, a newbie at SAS so would even appreciate the point in the right direction:
... View more
As I recently posted here, I'm trying to create Table 1 for a research journal article. @Reeza pointed me to the Table 1 macro "TableN" and it looks like exactly what I need.
I downloaded the macro and ran it, and then I tried to call it based on the example provided.
/*Example macro call*/
/*%tablen(data=example, by=arm,
var=age date_on sex race1 smoke_st num_met,
type=1 3 2, outdoc=~/ibm/example1.rtf);*/
/*My version*/
%tablen(data=have, by=TM_group,
var=DEM_AGE DEM_SEX,
type=2 2, outdoc="C:\data_output\test.rtf);
But I got an error after "by TM_group": ERROR: All positional parameters must precede keyword parameters. I looked up the error and it has something to do with the commas between the parameters. After some trial and error of deleting commas, I got it to run without error, but it doesn't produce any output.
Sample data is provided below:
data have;
infile datalines dsd dlm=',' truncover;
input DEM_AGE DEM_SEX cohort_flag TM_group;
datalines;
3,1,1,0
2,1,1,1
3,2,1,1
3,2,1,1
3,2,1,0
2,2,1,1
2,1,1,1
3,1,1,1
2,1,1,1
3,2,1,0
2,1,1,0
2,2,1,1
3,2,1,0
2,2,0,
3,2,1,1
3,2,1,1
3,1,1,0
3,2,1,0
2,1,1,0
3,1,1,1
3,2,1,1
3,2,1,0
3,2,1,1
3,2,1,1
3,2,1,1
; RUN;
proc format library=temp;
value age2grp
1='1:Age Group <65'
2='2:Age Group [65,75)'
3='3:Age Group >=75'
.='Inapplicable/Missing';
value sex
.='Inapplicable/Missing'
1='1:Male'
2='2:Female'
value yesfmt
1='1:Yes'
2='2:No'
.='Inapplicable/Missing'
;
RUN;
... View more
Hi everyone, I can see all the markers in the plot, but the corresponding admission dates on the x-axis are not fully visible. How can I adjust to see every admission date? proc shewhart data=VV; xchart LOS*admission_date /Markers outtable=outtable nohlabel TOTPANELS=1; run;proc print;run; Thanks,
... View more