Skip to content
Advertisement

Tag: sas

How to select numeric data of certain length

I am trying to select numeric data that is greater than 5 bytes. I have entered the below but get an error of ERROR: Function LENGTH requires a character expression as argument 1. Not sure what I am …

Writing SAS dates to SQL Server databse

How to write SAS dates to Microsoft SQL Server 2016 Date data type in database? I got SAS data with a sas date DataEndDay and I want to write that into a database. The following bit is in use (buffer is just to speed up the testing-failing) : Of course because SAS dates are numbers, direct writing is going to

SAS pass through query to SQL Server

I have some troubles with passing through query to SQL Server. OS is RedHat 6. In SAS Enterprise Guide I try to execute this code: but I faced with error: ERROR: CLI execute error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]INSERT failed because the following SET options have incorrect settings: ‘QUOTED_IDENTIFIER’. Verify that SET options are correct for use

How to add a sum column with respect to a group by

I have a table1 : And i want to add a column wich sum the count column by grouping the first two variables : this is what i do : then : But i have a feeling this is a sloppy way to do it. Do you know any better ways ? For example with no intermediates tables. edit :

Using macros in SAS SQL

I am wondering of I can consolidate some code into one PROC SQL statement instead of several back-to-back SQL statements. I am using macro to calculate the age of a participant at date of consent for a study, similar to what is provided here and here. I tried to troubleshoot the functionality of macros, and I calculated the total weight

Advertisement