BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Santt0sh
Lapis Lazuli | Level 10

Hi Experts,

 

I am not able to update one of the Core Dim tables on Postgres from a SAS Code.

I am using SAS AML 8.2 on  SAS Viya3.5. have modified the existing SAS DI Jobs and trying to run the SAS programs on SAS Studio I'm not sure why I am not able to update the table Postgres Core table, but I am able to insert rows into the same table.

Kindly note that I have not tried updating any other Core Tables as I need to make changes to SAS programs to insert or update records to other Dim tables.

 I have tried adding messages before the update query, the messages are printed but the update query is not initiating, or even if it's initiated I don't see any Error messages, Warning with respect to the update and SAS stops processing. I have also reset the &syscc.,&sqlrc.,&syserr., &trans_rc, &trans_rc to 0. which should not stop the code from processing. Please find the update query below that has changed the names of the table and variables.

---------------------------------------------------------------------------------

/* %rcSet(&syscc); */
%let syscc = 0;
options validvarname=v7;
%put &syscc.;

/* target table: update change rows */
%if &etls_change_rows ge 1 %then
%do;
proc sql;
update CORE.CRE_PARTY_DIM as n
set
prty_date_of_birth = (select prty_date_of_birth from work.xxxxxxxxx as k
where n.prty_key = k.prty_key),

other Update columns conditions continue....

-------------------------------------------------------------------------------------------------------

At the moment we are having some SAS Server maintenance activities going on, hence not able to provide log info for now.

Please suggest if, I am missing any privileges on the table or anything else.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20
INSERT and UPDATE are two different permissions in Postresql, so I wouldn't rule that out...

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
[, ...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...]
| ALL TABLES IN SCHEMA schema_name [, ...] }
TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
Data never sleeps

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Not sure what a core table is, and if that itself has anything to do with your problem?

You should ba ble to look into your target DB logs to see what's going on.

But lack of auhorization seems to be plausible problem.

To get information from an implict SQL statement, add this to your code:

options msglevel=i sastrace = ',,,d' sastraceloc = saslog nostsuffix;

 

Data never sleeps
Santt0sh
Lapis Lazuli | Level 10
Thanks for the reply!!!!

Core tables are nothing but Database tables which will be used to create
reports.

I have tried all the options, I have also added the log options mentioned
below but as the services were under maintenance I was not able share the
logs.

I don’t think Permission is an issue because I am able to insert records
into the cre.prty_dim table but not able to update the records.

I hope the services will be up soon I’ll try to run the code and share the
logs here.
LinusH
Tourmaline | Level 20
INSERT and UPDATE are two different permissions in Postresql, so I wouldn't rule that out...

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
[, ...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...]
| ALL TABLES IN SCHEMA schema_name [, ...] }
TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
Data never sleeps
Santt0sh
Lapis Lazuli | Level 10
Hi,
Thanks for your help,
DBIDIRECTEXEC was missing from Autoexec's...
After the Admin added it, it started working....

Appreciate all the Help and Suggestions!!!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1421 views
  • 0 likes
  • 2 in conversation