Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete a file in SQR (Process Scheduler)

Status
Not open for further replies.

MDGarcia

Programmer
Oct 7, 2004
64
PR
Hello everyone.

I'm running a routine in a SQR program to delete a file after it processes it. In SQRW works perfectly, but when I run the program through the System Process Request even though I have a successful return on the <call system using> command, the file is not deleted.

I have used the following commands:
1st try
let MyFile= d:\path_to_file\outputfile.txt
...program lines
let #MyResult= delete($MyFile)

2nd try
...
let $command= getenv('COMSPEC')||' /c del /q '||$MyFile
call system using $command #MyResult

3rd try
let $PS_PATH= 'd:\path_to_file\'
...
let $command= getenv($PS_PATH)||' /c del /q outputfile.txt'
call system using $command #MyResult

4th try
...
let $command= getenv($PS_PATH)||MyBatFile.bat
call system using $command #MyResult
where MyBatFile.bat:
cmd.exe /c del /q outputfile.txt
The .bat file is located where the file to be deleted is
created.
-------------- ----------------------
I believe I'm working in Windows environment. Would it be different if it is Unix?

Any suggestions will be greatly appreciated.

Thanks.
 
things to check...Assuming this is being run on the App server, make sure your App Server has access to the location you are deleting the file from and that permissions allow for deletion. The "successful" status basically means the job didn't abort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top