The problem is that if I run the command through the Putty, everything works fine, the table updates and no errors. But as soon as I run this code in SAS as:
X “sqlcmd ….”; the output says, that “SQLCMD: ERROR: Microsoft ODBC Driver 17 for SQL Server: Data source name not found”.
I want to compare multiple tables from different versions of .sql file. In order to do that, I want to run multiple sql files and save them in the system to compare them for later.
Since I am working in SAS, and SQL files contain the syntax, which SAS sql doesn’t recognize, I can’t just read the file and put it inside proc sql(I also can’t change the sql syntax, since it’s not in the scope of the work).
I decided to run the sqlcmd command to run the sql file. It worked, but as soon as I do it through SAS, I get that “SQLCMD: ERROR: Microsoft ODBC Driver 17 for SQL Server: Data source name not found” error, even though I am on the same server, as the same user.
I also tried to push the code into bash file and run this file from sas, but the same problem.
I am not sure why on the same server, under the same user, there are two results(positive and negative). Is there a way to run this sql without errors?