Desktop productivity for business analysts and programmers

executing a batch file

Reply
New Contributor
Posts: 4

executing a batch file

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
Super User
Posts: 5,851

Re: executing a batch file

Posted in reply to giovannych08
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
New Contributor
Posts: 4

Re: executing a batch file

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

Super User
Posts: 5,851

Re: executing a batch file

Posted in reply to giovannych08

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
New Contributor
Posts: 4

Re: executing a batch file

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

Respected Advisor
Posts: 4,674

Re: executing a batch file

[ Edited ]
Posted in reply to giovannych08

@giovannych08

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

Ask a Question
Discussion stats
  • 5 replies
  • 164 views
  • 0 likes
  • 3 in conversation