BookmarkSubscribeRSS Feed
giovannych08
Calcite | Level 5
Good afternoon, I need to run a .bat from SAS EG where I create 2 .txt files.
The same ones that are created empty when executing of SAS EG but if the same .bat is executed from the server from the CMD is executed normally and creates the files with information:

Attached as executing from SAS EG and .bat code

data _null_;
x "x:\1prueba.bat > x:\log.txt ";
run;



@echo off
Handle64 DIM_IP_TP.mdf.0.0.0.spds9 > x:\tabla.txt

for /f "tokens=3,6 skip=5 delims= " %%p in (x:\tabla.txt) do (
echo %%p %%q
)

Handle64 DIM_IP_TP.data.spds_lock9 > x:\tabla1.txt

for /f "tokens=3,6 skip=5 delims= " %%r in (x:\tabla1.txt) do (
echo %%r %%s
)

the .bat is to find the sessions (pid) that have taken an SPDS table to then kill the process


the user with whom I run is the sas admin and server admin
8 REPLIES 8
LinusH
Tourmaline | Level 20
You can yourself inside out to figure this one out.
Or, you can ask yourself (as one should do every time when you are tempted to call an external program from SAS) - do I really need to execute this from SAS?
This seems like a 100% OS environment thing, and solution.
Data never sleeps
giovannych08
Calcite | Level 5

Es necesario ya que SAS  no tiene herramientas solidas de monitoreo, es la única solución fiable para el desbloqueo de tablas a menos que SAS al día de hoy ya cuente herramienta o solución- tecnología al tema de bloqueos de tablas ya que por el momento es desastroso.

 

Con todo ya encontré la solución al llamar al .bat desde SAS  solo toca poner la ruta exacta y funciona.

 

Con todo gracias

LinusH
Tourmaline | Level 20

Perhaps there's another side of the story.

Could it be that you have problem with locking when you try to update the tables?

If you mainly do inserts you could easily solve this by using Dynamic Locking, and with almost no performance penalty at all.

Data never sleeps
giovannych08
Calcite | Level 5

Se aplica la opción   Dynamic Locking pero solo eso aplica cuando 2 o mas personas consultan datos (selects) a la tabla mas no cuando una persona ocupa la tabla y otra quiere actualizar, por eso es que se necesita aplicar el .bat no hay otra solución.

 

Con todo Gracias

Patrick
Opal | Level 21

@giovannych08

Was du hier schreibst ist spanisch für mich. Smiley Tongue

Rodrigo_Aegon
Calcite | Level 5

Your problem is because SAS Guide is executing in your operating system instead server operating system. It could be solved only running your .sas from the server with sasbatch user. Try to automatize your code with cron, for example, and your problem will be solved.

 

🙂

Patrick
Opal | Level 21

@Rodrigo_Aegon  Discussion from 3 years ago!

Rodrigo_Aegon
Calcite | Level 5

Yes. I realized it was in September but I didn't check in what year ... 😞

On the other hand, I don't like having open issues... XD

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!

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
  • 8 replies
  • 1953 views
  • 0 likes
  • 4 in conversation