Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day All,
Please could you advise on the following. I have a document that is scheduled daily. In the script I have section that saves a table to csv, this should only happen on a Monday. This always fails on a Monday, but if i reload manually it all works fine. this is my script
If WeekDay(Today()) = 'Mon' Then
LET vDStart = '2011/04/10';
LET vDEnd = Date(Today()-1);
TMPTable:
Load * Resident Table;
Table1:
Load * Resident TMPTable
Where
Date(Calendar) >= '$(vDStart)' and
Date(Calendar) <= '$(vDEnd)';
Drop Table TMPTable;
STORE Table1 into 'QVDPath:\FileName.csv'(txt);
DROP Table Table1;
End If;
Thank you in advance
Kamiel
Good day, Thnak you for all your help. After some digging,the error was that I needed to put the full unc path in the store section. I may have not explained that I was storing the csv file to a mapped drive.
Thank you
Any error messages or sample application?
In th log file, it just has general script failure
How do you automatically reload? server or batch file? If server, please check the server reload log for errors as well.
If the log files don't give you exactly what you want, then I have previously implemented bespoke logging by dumping variable states to a log like this ...
SUB Log (SeqNo,Message)
LET vSeqNo = SeqNo;
LET vlogTime = Now();
LET vMessage = Message;
IF NOT(IsNull(vMessage)) THEN
Logging:
LOAD
'$(vSeqNo)' as SeqNo,
'$(vlogTime)' as logTime,
'$(vMessage)' AS logMessage
AUTOGENERATE 1;
ENDIF
Store Logging into Log.txt (txt);
ENDSUB;
If Weekday(Today())='Tue' Then
CALL Log('001',Weekday(Today()));
Let vDStart = '10/04/2011'; CALL Log('002','$(vDStart)');
Let vDEnd = Date(Today()-1); CALL Log('003','$(vDEnd)');
Let vFail = Evaluate(100/0); CALL Log('004','$(vFail)'); // divide by zero error
End If;
This might help trap the exact point of failure.
flipside
Hi,
this precess is automated.In the event viewer -document failed to reload error count =3
kamielrajaram,
are you sure that in the environment where you reload application (server presumably), you have day namings like 'Mon', 'Tue', etc. and date format 'YYYY/MM/DD' and not any other (e.g. in native language)? Do you have according SET statements in your script?
Hi Dmitry,
this is in my script
Set DayNames = 'Mon;Tue;Wed;Thu;Fri;Sat;Sun';
Set DateFormat = 'YYY/MM/DD';
Why do you have YYY (3 letters) instead of more common YYYY (4 letter) ?
Sorry was a typo, it is YYYY/MM/DD