Hi all,
I am trying to use SAS to append a dataset into a SQL table.
I am using this code (modified the table names). My dates are in YYDDMM10. format, numeric = type, length = 8, informat =10. and they cannot be appended because of type of mismatch. The variables in the SQL table is set to the data type = "date" and it has allow nulls checked off.
any help is appreciated!! >.<
libname Dummy odbc dsn='Dummy_data' schema=stg;
data org.procedures; set procedures; RunDate = today(); format RunDate date9.; if firstobs then Obs_ID = 1; else Obs_ID +1; run;
*remove exisiting data from table;
data Dummy.data_Numerators;
modify Dummy.data_Numerators;
if Obs_ID not = '.0y' then
remove Dummy.data_Numerators;
run;
*append new data to table;
proc append data= org.procedures base = Dummy.data_Numerators force; run;
... View more
I'm trying to follow the code on this site Test for the equality of two proportions in SAS - The DO Loop for the section called A chi-square test for association in SAS. I basically need to compare the proportion in one area which was tested for something to the proportion in another area which was tested and see if they are significantly different proportions, but I can't get the code to work right. I get this error:
NOTE: Invalid data for N in line 79 1-6.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
79 CountyB Yes 71
Group=CountyA Seq=No N=. _ERROR_=1 _N_=2
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
My full code is:
data underfive; length Group $15 Test $3; input Group Test N; datalines; CountyA Yes 55 CountyA No 45027 CountyB Yes 71 CountyB No 311726;
Once I had that in I figured I would run this:
proc freq data=underfive order=data; weight N; tables Group*Test/chisq; run;
... View more
Hello SAS community, I'm very confused about how SAS deciphers "IF" Statements in the DATA step. In this specific case, I'm working with an account dataset that has some conflicting information about when accounts close, and I am constructing an "effective" close date. Earlier in my data step, I used some IF statements to construct my desired close date. The last step is to convert that numeric close date to a string variable in the format YYYYMM. Here's what I tried: DATA WORK.dates_test;
SET WORK.raw_dates;
close_eff_n = acct_close_dte_n; IF closed = 1 AND acct_close_dte_n = . THEN DO; close_eff_n = maxdate_n; END;
*(omitting some additional logic used here for parsimony);
IF close_eff_n > 0 THEN DO;
close_dte_eff = put(close_eff_n,yymmn.);
END;
RUN; I had earlier written this last segment as: close_dte_eff = put(close_eff_n,yymmn.); but this populated the string variable close_dte_eff with a value of "." when close_eff_n was missing, which is why I'm now trying to implement this conditional logic. The problem is: where this condition fails, SAS populates the close_dte_eff field with whatever the last non-failed value was, which is completely incorrect. e.g. I have: close_eff_n 01MAR2023 01APR2023 . . 01JUL2021 I want: close_eff_n close_dte_eff 01MAR2023 202303 01APR2023 202304 . . 01JUL2021 202107 But instead I get: close_eff_n close_dte_eff 01MAR2023 202303 01APR2023 202304 . 202304 . 202304 01JUL2021 202107 When I tried to replicate this problem with a simplified dataset, i.e. just taking the final input variables and creating the desired output, I got the result I want, so I suspect it might have something to do with the preceding IF-statements. I can think of plenty of workarounds to get this to work as intended, so my question is not so much how to fix this, but why is this happening? There's something fundamental about how the "IF-statement" is being processed where rows that fail the "IF" condition are being populated with the value of the last row that met that condition, and I would like to understand when SAS applies this behavior and when it does not. I can see this being a useful feature in some limited cases, but it's generally not what I would want to do when applying conditional logic. I had thought that these sort of situations where SAS operates on one row depending on what was in the previous row only happen when there is a "BY" statement, but obviously that's incorrect as there is no "BY" statement in this DATA step. I'd really appreciate some explanation as to when actions are applied to rows that do not meet the specified condition in an "IF" statement, and how to control that behavior, so I can make sure that the commands I write are applying to the rows that I expect them to apply to. Please let me know if I can provide any other context or information that would be helpful. Many thanks, Scott
... View more
The deployment backup is failing in our SAS 9.4 M6 environment (OS: AIX). This is the only error in the log:
2024-04-23 14:40:48,770 [tomcat-http--17] ERROR [sasadm] com.sas.svcs.backup.spi.BackupServiceImpl - The backup failed
When I enabled debug logging, I saw some additional details:
2024-04-23 14:39:14,524 [executor-1] INFO [sasadm] com.sas.svcs.backup.dao.BackupServerHelperDAO - Received Status code: FAIL
2024-04-23 14:39:14,524 [executor-1] DEBUG [sasadm] com.sas.svcs.backup.dao.BackupServerHelperDAO - Log file path: /opt/sas/config/Lev3/Backup/Logs/2024-04-23T11_03_58/backup/ConfigDir
I checked the log inside ../ConfigDir. This is the error message:
2024-04-23 14:39:11,979 [main] ERROR com.sas.svcs.backup.server.BackupDriver - An exception while running the BackupServer executable, Exiting..... : SAS configuration directory backed failed.
Error Code: 999, Stack Trace: SAS configuration directory backed failed., java.lang.OutOfMemoryError: Java heap spacecom.sas.apps.content.migration.core.ContentMigrationAdapter.migrateContents(ContentMigrationAdapter.java:21) com.sas.svcs.backup.server.handler.LevconfigBackupHandler.execute(LevconfigBackupHandler.java:254)...
I tried increasing the jvm values for SASServer1_1 from Xmx4096m and Xms1024m to Xmx8192m and Xms4096m . But it did not resolve the issue. Anyone has any idea how to resolve this? The ../ConfigDir is in the compute server. Should I increase java heap space in compute? Thanks in advance!
... View more
Hi
I deleted the "dagentsrv-viya4" client from my SAS Viya installation when using the sas-admin CLI, I ran the command:
sas-admin oauth deregister-client --id dagentsrv-viya4
how do I create the client again with the right settings?
Thanks
... View more