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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch VI Job - Checking For Success

Status
Not open for further replies.

richcwi

Programmer
Feb 6, 2007
16
US

Folks,

Any good suggestion for checking for success in a batch VI Job. Seems like PVXWIN32.EXE always returns 0 regardless of any error.

Thanks,
Rich
 
I started looking into one *really* kludgy solution, which is to chain it to an export job that would create a file. But I wanted the file to reflect some of the import, so I haven't implemented it yet because I don't know what to export.

I am going to try exporting just a simple file - country codes or something. I'll let you know what I find out.

Dave
 
Hi Richcwi,

My tests indicate that I will be able to use this method, but there are a few caveats, and maybe you have some advice for me on them.

I created a new VI Export job "SUCCESS TEST" that just exports the names of tax schedules (a nice small file) into a file on the server (we run automated imports from the server) called success_test.csv.

I chained to this SUCCESS TEST from the import jobs that I call on a schedule from a batch file so that whenever an import job runs, the success test runs after it.

I added to the batch file that calls PVXWIN32.EXE so that it looks like this now:
Code:
D:
cd \200cs\MAS90\Home
ren ...\invoices.csv pending.csv
del D:\autovijobs\success_test.csv
PVXWIN32.EXE  ../launcher/sota.ini ..\SOA\MAS90  -ARG ..\VI\VIWI3V W 0 DIRECT AUTO LFL
if EXIST D:\autovijobs\success_test.csv (
    echo %date% %time%: VIWI3V >> D:\autovijobs\imports.txt
    del D:\autovijobs\success_test.csv
)
ren ...\pending.csv %date:~10,4%%date:~4,2%%date:~7,2%invoices.csv

We rename the file being imported to pending.csv to indicate that the automated import started. Once complete, we rename it to the date to indicate that it finished. Now, if it was successful, we'll get a line with the date and time at which it was successful written into the import.txt file.

If an error occurs in PVXWIN32 (too many users or some .soa is locked), a message box pops up on the server console and stays there until someone clears it. The batch file then waits for the message box to be cleared. If we get a line in imports.txt, then we know that the job ran successfully whether or not such a message box (sometimes with "retry") popped up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top