BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Azeem112
Quartz | Level 8

I want to run a code at a specific time, daily, that code reads from the Sasoprsk library and generate emails. For reading the data from Sasoprsk library, first I've to run the autoexec.sas to register it.

 

I created a batch file and run it using Task Scheduler.  

 

My batch file code looks like

 

"D:\SAS\SASHome\SASFoundation\9.4\sas.exe" -SYSIN "D:\SAS\SASConfig\Lev1\Applications\SASEnterpriseGRCServerCfg\6.1\Source\sasstp\test_email.sas" -LOG "D:\Notifications\test_email.log"

I included autoexec in my code using %inc statement.

 

After running it from task shedular, I received this log error and my code stops running.

 

Log Error

 

MPRINT(ORM_DB_LIBNAME):   libname sasoprsk ODBC datasrc=SAS_EGRC_PROD authdomain=GRC_db_auth dbmax_text=4000 connection=shared;
ERROR: Libref SASOPRSK is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR: Libref SASOPRSK is not assigned.
ERROR: Execution canceled by an %ABORT CANCEL statement.
NOTE: The SAS System stopped processing due to receiving a CANCEL request.
ERROR: Errors printed on page 2.

 

I tried to run autoexec from batch file as

 

 

"D:\SAS\SASHome\SASFoundation\9.4\sas.exe" -SYSIN "D:\SAS\SASConfig\Lev1\Applications\SASEnterpriseGRCServerCfg\6.1\Source\ucmacros\orm_autoexec.sas" -LOG "D:\Notifications\test.log"

but Error is same. 

 

It is possibly due to that pop up, because if i run my code manually it works fine. All fields of pop up window are auto saved but may be, because no one is there to press OK button of popup window. 

 

Kindly suggest an approach to register sasoprsk library by running autoexec.sas from batch file.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Azeem112
Quartz | Level 8

Dear Ballardw,

 

I've attached the screenshot of that pop up, however I've found a solution of it using libname odbc. I made the connection in ODBC with live database of application and and then using libname odbc I created a libname of name "Sasoprsk". It worked.

Thanks.

View solution in original post

2 REPLIES 2
ballardw
Super User

Can you post a screen capture of the "pop up"? We would need so information about that if it is the culprit.

 

I would look into the session ODBC settings in general also since your failure relates to an ODBC LIBNAME.

If you "manual" run is using your local machine ODBC settings a batch run under Enterprise Guide may not recognize your local computer ODBC but is attempting to use the EG server settings.

Azeem112
Quartz | Level 8

Dear Ballardw,

 

I've attached the screenshot of that pop up, however I've found a solution of it using libname odbc. I made the connection in ODBC with live database of application and and then using libname odbc I created a libname of name "Sasoprsk". It worked.

Thanks.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 2 replies
  • 1405 views
  • 2 likes
  • 2 in conversation