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 trying to BULKLOAD a SAS dataset into Snowflake and I am having trouble with the DATETIME column in my SAS dataset. When trying to load it into Snowflake, I get the error message: ERROR: Error executing COPY command: Numeric value '2016-01-08 14:20:34.000000000' is not recognized File '@~/nucleus/xxxxx.gz', line 6187, character 186 Row 6187, column " CLR_CALL_ACTIV_HIST_2016 "["INTERACTION-ID":21] If you would like to continue loading when an error is encountered, use other values such as 'SKIP_FILE' or 'CONTINUE' for the ON_ERROR option. For more information on loading options, please run 'info loading_data' in a SQL client. For reference, here is my SAS code: /* Transform the data */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_0;
/* Load in work table containing the pre-transformed file */
SET WORK.CLR_CALL_ACTIV_HIST_2016_0;
/* Transformations */
'CHANNEL-ID-NUM'N = INPUT(STRIP('CHANNEL-ID'N), BEST32.);
IF MISSING('CHANNEL-OBJ-ID'N) OR UPCASE('CHANNEL-OBJ-ID'N) = "N/A" THEN
'CHANNEL-OBJ-ID-NUM'N = .;
ELSE
'CHANNEL-OBJ-ID-NUM'N = INPUT(STRIP('CHANNEL-OBJ-ID'N), BEST32.);
'GROUP-ID-NUM'N = INPUT(STRIP('GROUP-ID'N), BEST32.);
'INTERACTION-ID-NUM'N = INPUT(STRIP('INTERACTION-ID'N), BEST32.);
'DATE'N = INPUT(SUBSTR('TRANS-ACCEPT-TIME'N, 1, 10), YYMMDD10.);
FORMAT 'DATE'N YYMMDD10.;
'TIME'N = INPUT(SUBSTR('TRANS-ACCEPT-TIME'N, 12, 8), TIME8.);
FORMAT 'TIME'N TIME8.;
'DATETIME'N = DHMS('DATE'N, HOUR('TIME'N), MINUTE('TIME'N), SECOND('TIME'N));
FORMAT 'DATETIME'N DATETIME20.;
'TRANS-POST-PROC-TIME-NUM'N = INPUT(STRIP('TRANS-POST-PROC-TIME'N), BEST32.);
'TRANS-PROC-TIME-NUM'N = INPUT(STRIP('TRANS-PROC-TIME'N), BEST32.);
'TRANS-REC-NUM-NUM'N = INPUT(STRIP('TRANS-REC-NUM'N), BEST32.);
'TRANS-TOTAL-TIME-NUM'N = INPUT(STRIP('TRANS-TOTAL-TIME'N), BEST32.);
'TRANSACTION-ID-NUM'N = INPUT(STRIP('TRANSACTION-ID'N), BEST32.);
RUN;
/* Drop columns */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_1;
SET WORK.CLR_CALL_ACTIV_HIST_2016_0;
DROP 'CHANNEL-ID'N
'CHANNEL-OBJ-ID'N
'GROUP-ID'N
'INTERACTION-ID'N
'TRANS-ACCEPT-TIME'N
'DATE'N
'TIME'N
'TRANS-POST-PROC-TIME'N
'TRANS-PROC-TIME'N
'TRANS-REC-NUM'N
'TRANS-TOTAL-TIME'N
'TRANSACTION-ID'N
;
RUN;
/* Rename columns */
DATA WORK.CLR_CALL_ACTIV_HIST_2016_2;
SET WORK.CLR_CALL_ACTIV_HIST_2016_1;
RENAME 'CHANNEL-ID-NUM'N = 'CHANNEL-ID'n
'CHANNEL-OBJ-ID-NUM'N = 'CHANNEL-OBJ-ID'N
'GROUP-ID-NUM'N = 'GROUP-ID'N
'INTERACTION-ID-NUM'N = 'INTERACTION-ID'N
'DATETIME'N = 'TRANS-ACCEPT-TIME'N
'TRANS-POST-PROC-TIME-NUM'N = 'TRANS-POST-PROC-TIME'N
'TRANS-PROC-TIME-NUM'N = 'TRANS-PROC-TIME'N
'TRANS-REC-NUM-NUM'N = 'TRANS-REC-NUM'N
'TRANS-TOTAL-TIME-NUM'N = 'TRANS-TOTAL-TIME'N
'TRANSACTION-ID-NUM'N = 'TRANSACTION-ID'N
;
RUN;
/* Load final table */
DATA WORK.CLR_CALL_ACTIV_HIST_2016;
SET WORK.CLR_CALL_ACTIV_HIST_2016_2;
RUN; Here is my Snowflake connector code: libname NUC_LIB snow
SERVER = "xxxx"
USER = "xxxx"
PASSWORD = "xxxx"
DATABASE = "xxxx"
SCHEMA = "xxxx"
ROLE = "xxxx"
WAREHOUSE = "xxxx"
;
DATA NUC_LIB.CLR_CALL_ACTIV_HIST_2016
(
BULKLOAD = YES
BL_INTERNAL_STAGE = "user/nucleus"
BL_COMPRESS = YES
BL_DELETE_DATAFILE = YES
DBCOMMIT = 1000000
);
SET WORK.CLR_CALL_ACTIV_HIST_2016;
RUN; Essentially, I need the DATETIME columns from SAS to be DATETIME columns in Snowflake.
... View more
Hi, Can someone point out to any documentation that list the functional differences between SAS Data Integration Studio 4.9 available in SAS 9.4M7 vs SAS Data Studio available in SAS Viya 2022.1.4
... View more
Can you tell me what is wrong with this code?
*OTHER NEUROLOGICAL DISEASES; array xx $ icdx1 icdx2 icdx3; label ond="Oth neurological"; ond=0; do over xx; if xx in: ("B90", "D48", "G04", "G09", "G10", "G11", "G12", "G13", "G24", "G25", "G26", "G32", "G37", "G51", "G52", "G53", "G70", "G71", "G72", "G73", "G80", "G81", "G82", "G83", "G90", "G91", "G93", "G95", "G99", "M47", "Q00", "Q01", "Q02", "Q03", "Q04", "Q05", "Q06", "Q07", "Q76") then ond = 1; *Doing exclusions in this way does not work; if xx in: ("G130", "G131", "G251", "G254", "G256", "G510", "G732", "G733", "G734", "G838") then ond=0; end;
The first part works fine. But then when I add in the line of code under *Doing exclusions in this way does not work; I get the following error messages:
*Doing the exclusions in this way does not work; 509 if xx in: ("G130", "G131", "G251", "G254", "G256", "G510", "G732", _ 22 202 509 ! "G733", "G734", "G838") then ond=0; ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, iterator, (.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
510 end;
Please help! Thanks!
... View more
Hello, I ran a linear mixed model with repeated measures using PROC MIXED. I used the RCORR statement to obtain the intraclass correlation coefficient (ICC) for the non-independent variable 'score' across readers. Is there a function within PROC MIXED that outputs the 95% CI and p-value for the ICC? PROC MIXED DATA=final COVTEST;
CLASS subject_id reader (REF='1');
MODEL score = reader / S CL;
REPEATED / SUBJECT=subject_id TYPE=cs R RCORR;
RUN; Thank you for your help!
... View more
Dear All How can I calculate 95% confidence intervals for ICCs with SAS macro (%intracc) (http://support.sas.com/kb/25/031.html). I am trying to calculate ICC(2,k) but %intracc but the macro produce only ICCs but not 95% CIs. Thank you. Best regards,
... View more