Creating an AI Assistant for SAS Viya in 5 steps (@sassoftware/viya-assistantjs) - Part I
Recent Library Articles
Recently in the SAS Community Library: SAS' @kumardeva debunks the myth that developing AI assistants is too hard. He shows you how to use the @sassoftware/viya-assistantjs library to jump start your development.
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
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
I trying to query company LDAP and extract users from a specific AD Group. I can query/filter on uid, department, etc.... but when trying to pull all users of a specific group, or any group, Suchas with memberof, example filter below, I get no results.
Any suggestions/help?
filter="(&(memberOf=cn=myteam_AD_group,OU=groups,DC=com))";
full code below...
options mprint mlogic ;
%let Attrs= "uid sn givenname groupMembershipSAM, grouppriority groupsToIgnore memberof " ||
"acting comat comatstationid companycode cosspecifier " ||
"costcenter countrycode createtimestamp dc " ||
"delegated departmentaltcontactname departmentcity " ||
"departmentcomailaddress departmentcontactname departmentcostcenter " ||
"departmentcountry departmentdescription departmentdivision departmentkeywords " ||
"departmentlongname departmentname departmentnumber departmentphone departmentpostal " ||
"displayname employeenumber employmentstatuscode employeetype employmenttypecode entrydn " ||
"exemptnonexempt expatintlcomaddr fxdivision fxexecbcdraccess fxjobfamily fxjobfunctioncode " ||
"fxregion fxsoxstatus fxssomemberof givenName icscalendar inetCanonicalDomainName " ||
"inetDomainBaseDN inetDomainStatus inetMailGroupStatus inetUserStatus initials " ||
"jobnumber mail mailAlternateAddress mailEquivalentAddress mailfxaccounttype mailfxhome " ||
"mailHost mailRoutingHosts mailUserStatus managementlevel manager member " ||
"memberOfManagedGroup memberOfPAB memberOfPABGroup modifytimestamp nickname " ||
"nsCalXItemId nscpEntryDN nsds5ReplConflict nsLIProfileName " ||
"nsUniqueId nswcalCALID ntGroupDomainId ntUserDomainId numsubordinates " ||
"ou owner parentid pipstatus pipuid positionnumber postalcode " ||
"postaladdress street isActive isActiveSpecified " ||
"seeAlso sn telephoneNumber tempworklocation title uid un " ||
"uniquemember vendortype workstate xuid"
;
%put &Attrs ;
%put &emp ;
data rpt_output ;
length entryname $200 attrName $100 value $100 filter $100;
rc =0; handle =0;
server="directory.company.com";
port=389;
base="ou=people,o=company,c=us";
bindDN=""; Pw="";
/* open connection to LDAP server */
call ldaps_open(handle, server, port, base, bindDn, Pw, rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else
put "LDAPS_OPEN call successful.";
shandle=0;
num=0;
filter="(&(objectCategory=user)(memberOf=myteam_AD_group,))";
/* filter below works for individual employees */ /*filter="(&(uid=&emp))";*/
/* search the LDAP directory */
call ldaps_search(handle,shandle,filter, attrs, num, rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else do;
put " ";
put "LDAPS_SEARCH call successful.";
put "Num entries returned is " num;
put " ";
end;
do eIndex = 1 to num;
numAttrs=0;
entryname='';
/* retrieve each entry name and number of attributes */
call ldaps_entry(shandle, eIndex, entryname, numAttrs, rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else do;
put " ";
put "LDAPS_ENTRY call successful.";
put "Num attributes returned is " numAttrs;
end;
/* for each attribute, retrieve name and values */
do aIndex = 1 to numAttrs;
attrName='';
numValues=0;
call ldaps_attrName(shandle, eIndex, aIndex, attrName, numValues, rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else do;
put " ";
put "Attribute name is " attrName;
put "Num values returned is " numValues;
end;
do vIndex = 1 to numValues;
call ldaps_attrValue(shandle, eIndex, aIndex, vIndex, value, rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else do;
put "Value : " value;
put "Attribute nbr is " numValues;
Output rpt_output;
end;
end;
end;
end;
/* free search resources */
call ldaps_free(shandle,rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else
put "LDAPS_FREE call successful.";
/* close connection to LDAP server */
call ldaps_close(handle,rc);
if rc ne 0 then do;
msg = sysmsg();
put msg;
end;
else
put "LDAPS_CLOSE call successful.";
run;
quit;
... View more
I have a exported an excel report that contains empty cells and would like to write a code that would color all empty cells in the excel output. I have the following code which only highlights/colors empty cells in the NAME column, however I'd like to highlight all empty cells without having to write out code for all 47 columns that I have in my report : PROC REPORT DATA = STAGE1; DEFINE NAME -- REFERRAL_BASIS/ DISPLAY; COMPUTE NAME; IF NAME= '' THEN CALL DEFINE('NAME', "STYLE", "STYLE=[BACKGROUND=CYAN]"); ENDCOMP; RUN;
... View more
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