Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I hope all are doing good.
I have a requirement to read the start and end time of batch jobs and store in qvd. For this I need to get the task name from text and call into table, and store into qvd. Example: In below script text is $(Include=D:\script\create_order.qvs). I need to get the "create_order" as the task name and call into "Sales" table then store into qvd.
LET vStartTime = Now();
$(Include=D:\script\create_order.qvs)
LET vEndTime = Now();
Sales:
LOAD
'create_order' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
LET vStartTime = Now();
$(Include=D:\script\derive_order.qvs)
LET vEndTime = Now();
Sales:
LOAD
'derive_order' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
Hope you understand requirement. let me know if you need any information.
Thanks
Ajay
What is your question? You appear to have done everything except:
You need a Concatenate LOAD statement to get the log file history from the qvd
and a 'STORE Sales' statement to save the updated log file.
what is the problem statement?
Hi Jonathan,
I don't want to write "create_order" or "derive_order" in Sales table, it should automatically read from the texts $(Include=D:\script\create_order.qvs),.....
then i will concatenate these tables ans store into qvd.
HI,
You can create a Bucle... to read all qvds.
And the the file will be the name.
For each File in filelist ('c:\directory\'
LOAD $(File) as Name .......
next File
Regards
set vFilePath='D:\script\create_order.qvs';
let vFileName=subfield(TextBetween('$(vFile)','\','.'),'\',-1);
LET vStartTime = Now();
$(Include='$(vFilePath)');
LET vEndTime = Now();
Sales:
LOAD
'$(vFileName)' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
HTH
Sasi
set i=0;
set vConcatenate='';
sub GetFileNames(DirName,extension)
for each FoundFile in filelist(DirName & extension)
if i>0 then
let vConcatenate='Concatenate';
End if
let i=i+1;
let vFileName=subfield(TextBetween('$(FoundFile)','\','.'),'\',-1);
LET vStartTime = Now();
$(Include='$(vFilePath)');
LET vEndTime = Now();
Sales:
Load
'$(vFileName)' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
next FoundFile
end sub
Call GetFileNames('D:\script\','*.qvs');
Hi
Did you manage to solve your problem?
Sasi