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, I am getting the following error messages when trying to merge two datasets. One of the datasets I am getting from a csv file, so maybe the issue could be there? I was trying to specify the length of the PID variable for the redcap_sort dataset from the redcap one, which is the one we got from the csv file. However, I keep getting messages that the variable has multiple lengths and it keeps truncating the data. Any PID after 999 gets shortened. So 1000 and 1001 become 100, 1010 becomes 101, etc. Any help or a nudge in the right direction would be greatly appreciated, thank you so much. Edit: The programming with the csv file already has: data work.redcap; %let _EFIERR_ = 0;
infile &csv_file delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=1 ;
informat pid $500. ;
informat pid_ini $500. ; and the code for format: format pid $500. ; It has this for all the variables. I thought the above code would make it so that the variables would have that limit of 500 characters?
... View more
I recently started using the TableN macro and I wanted to say thank you to @JeffMeyers for providing such a useful macro! I was able to produce Table 1 for TM_group (which is a binary variable with values 0,1). However, I would now like to create Table 1 for subgroups based on the ADRD_group variable (which is also 0,1). The documentation for the macro indicates the COLBY option can do exactly what I'm looking for, and provides an example output table with Gender and Arm. However, I can't find good example syntax of how to add the COLBY option to the code. I've tried a few variations, but I keep getting errors. Below is my latest version.
%tablen(
data=have;
,by=TM_group
.colby=ADRD_group
,var=DEM_AGE DEM_SEX
,type=2 2
,outdoc=C:\Users\r\Desktop\TM vs MA ADRD Table 1(&version.).rtf
);
... View more
Hi all, I have successfully created an annotated state map from geocoded address info using the states map. However, when I try to use the county map data set, it appears that the geocoding output does not match what information in the county map dataset. Here is a small program to illustrate the difficulty. Code doesn't get past proc gproject. It seems that the length of x and y of the map do not match the length of x and y in the geocoded output. thanks! Phil : libname lookup "D:\Documents\desi2023\frlanalyses\geocodedata__2006__ZIP4_Geocode_Data\data"; data zips; input c zip; anno_flag=1l cards; 1 65203 2 65211 3 65201 ; proc geocode /* Invoke geocoding procedure */ method=plus4 /* Specify geocoding method */ lookup=lookup.zip4 /* Lookup data from MapsOnline */ data=zips /* Input data set to geocode */ out=geocodedzips; /* Specify name of Output data set of locations */ run; data mocounties;set maps.counties;if state=29; data mocounties;set mocounties geocodedzips;run; proc gproject data=mocounties out=MOCountiesP; id state ; run; data my_map locations; set mocountiesP; if anno_flag=1 then output locations; else output my_map; run; data anno_locations; set locations; if c=1 then color="red"; if c=2 then color="bib"; if c=3 then color="viyg"; if c=4 then color="bippk"; xsys='2'; ysys='2'; hsys='3'; when='a'; function='pie'; rotate=360; size=.5; style='psolid'; output; length html $300; html='title='||quote(trim(left(citystate))||'0d'x||trim(left(put(zip,z5.)))); style='pempty'; color='deb'; output; run; pattern1 v=e; proc gmap data=mymap map=mymap anno=anno_locations; id county; choro segment / coutline=black levels=1 nolegend coutline=gray99;run;
... View more
Hello, I am getting this error message for INPUT function, could anyone please help me with this issue? TIA. Here is my code: data lb; merge adsl(in=a) lb1(in=b); length AVALC $50. SUBJID $15.; by USUBJID; if a and b; INDEX+1; SUBJID=substr(USUBJID,13,7); AVAL=LBSTRESN; AVALC=LBSTRESC; if LBCAT='COAGULATION' and LBTESTCD in ('APTT' 'INR' 'PT') or LBCAT='URINALYSIS' and LBTESTCD in ('URBILV' 'URGLUV' 'URPHV' 'URPROTV' 'URSGV'); run; proc sort data=lb1(where=(index(TRT01A,'Placebo')>0 and LBDTC^='')) out=lb_1(where=(input(LBDTC,e8601dt16.)<=TRTSDTM)); by INDEX; run; I'm getting ERROR: INPUT function reported 'ERROR: Invalid date value' while processing WHERE clause. LBDTC is character 2023-11-07T12:50
... View more