BookmarkSubscribeRSS Feed
ALOKVB86
Calcite | Level 5

Update statement in data step is not executing through SAS DI but same is executing through EG. PFB the code we are trying to execute.

 

DATA TRANSACTION;
FORMAT JOB_RUN_SKEY 20. JOB_END_TIME DATETIME20.;
JOB_STATUS_CDE = -1;
JOB_RUN_SKEY =&JOB_RUN_SKEY.;
JOB_END_TIME=DATETIME();
RUN;

data ODSDMSAS.DSI_PROD_CTRL_TBL;
modify ODSDMSAS.DSI_PROD_CTRL_TBL (WHERE=(JOB_RUN_SKEY =&JOB_RUN_SKEY.))
transaction
;

by JOB_RUN_SKEY;
RUN;

 

 

Log:

 

NOTE: The data set ODSDMSAS.DSI_PROD_CTRL_TBL has been updated.  There were 0 observations rewritten, 0 observations added and 0 observations deleted.
NOTE: There were 0 observations read from the data set WORK.TRANSACTION.

 

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please avoid shouting uppercase code at us.  The first thing that jumps out at me is that you are filtering the master dataset (with a where clause), but this is not how update works.  If you are trying to add a new record, then set the small dataset to the big one.  If you updating where the id exists, then the by line will do that.  Also, as you have not provided any test data - in the form of a datastep, nor even provided what the macro job_key_skey is, we have nothing to work with to diagnose any further.

ballardw
Super User

This statement

NOTE: There were 0 observations read from the data set WORK.TRANSACTION.

says there were no records in the data set you named transaction. So with nothing read from that set nothing was available to update or modify the data. So you need to examine the log for where your transaction set is made. Since we have nothing for your macro variable &Job_run_skey we cannot tell whether that might be an issue or not. If the macro variable was undefined then the data step would have and error and an empty data set created.

 

 

Modify is no the same as Update though.

ALOKVB86
Calcite | Level 5

Hi

 

I am intending to update status table once DI job gets completed. Once job executes successfully status_code updates properly to 1 but once encountered an error it's not updating at all. We tried proc sql but it was not working so tried data step to update.

 

MPRINT(JOB_IS_ERRR_EXIST): DATA TRANSACTION;
MPRINT(JOB_IS_ERRR_EXIST): FORMAT JOB_RUN_SKEY 20. JOB_END_TIME DATETIME20.;
MPRINT(JOB_IS_ERRR_EXIST): JOB_STATUS_CDE = -1;
SYMBOLGEN: Macro variable JOB_RUN_SKEY resolves to 1857990024574
MPRINT(JOB_IS_ERRR_EXIST): JOB_RUN_SKEY =1857990024574;
MPRINT(JOB_IS_ERRR_EXIST): JOB_END_TIME=DATETIME();
MPRINT(JOB_IS_ERRR_EXIST): RUN;

NOTE: Compression was disabled for data set WORK.TRANSACTION because compression overhead would increase the size of the data set.
NOTE: The data set WORK.TRANSACTION has 1 observations and 3 variables.
PROCEDURE| _DISARM| STOP| _DISARM| 2018-11-16T12:21:14,175+05:1800| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | _DISARM| 25952256| _DISARM| 17993728| _DISARM| 14| _DISARM| 15| _DISARM| 136| _DISARM| 21478| _DISARM| 0.000000| _DISARM|
0.002801| _DISARM| 1857970274.173060| _DISARM| 1857970274.175861| _DISARM| 0.000000| _DISARM| | _ENDDISARM
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

MPRINT(JOB_IS_ERRR_EXIST): data ODSDMSAS.DSI_PROD_CTRL_TBL;
MPRINT(JOB_IS_ERRR_EXIST): modify ODSDMSAS.DSI_PROD_CTRL_TBL TRANSACTION ;
MPRINT(JOB_IS_ERRR_EXIST): by JOB_RUN_SKEY;
MPRINT(JOB_IS_ERRR_EXIST): RUN;
36 The SAS System 12:20 Friday, November 16, 2018


NOTE: The data set ODSDMSAS.DSI_PROD_CTRL_TBL has been updated. There were 0 observations rewritten, 0 observations added and 0 observations deleted.
NOTE: There were 0 observations read from the data set WORK.TRANSACTION.
PROCEDURE| _DISARM| STOP| _DISARM| 2018-11-16T12:21:14,510+05:1800| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | _DISARM| 25952256| _DISARM| 17993728| _DISARM| 14| _DISARM| 15| _DISARM| 0| _DISARM| 21478| _DISARM| 0.020000| _DISARM|
0.333983| _DISARM| 1857970274.176700| _DISARM| 1857970274.510683| _DISARM| 0.010000| _DISARM| | _ENDDISARM
NOTE: DATA statement used (Total process time):
real time 0.33 seconds
cpu time 0.02 seconds

 

 

JOB_RUN_SKEYJOB_IDJOB_NAMEJOB_SAS_CDETGT_TBL_NMETGT_TBL_DESCJOB_ETL_NMEJOB_START_TIMEJOB_END_TIMEJOB_STATUS_CDE
1857990024574574ABR_PREPAID_CARDS_JOB   ABR_PREPAID_CARDS_JOB16Nov2018 12:20:24 0

 

 

Status Code 0 meaning job has been executed. Once job got an error status code didn't change.

 

Please help

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1087 views
  • 0 likes
  • 3 in conversation