Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi their,
Please help me on urgent basis.
from the below script (vPrevYearMonthDay &'-'& vYearMonthDay files are not generated from specific path)
so getting error as GroupOther table not found:
need to exit IF statement with out Executing GroupOther table.
let vFileName = '\\am.mds.honda.com\HCM\HCM_Shared_INDX\SourceDocuments\Prod\Management\Cell Phones\Data\'& vPrevYearMonthDay &'-'& vYearMonthDay &'-GroupSummary-1488418-HONDA OF CANADA MFG - PCS 30%.txt';
Let vFileExsist=if(FileSize('$(vFileName)')>0,-1,0);
if $(vFileExsist) then
GroupOther:
//LOAD *,
// Autonumber(Date(Date#([Bill Date],'DD-MMM-YY'),'YYYY-MM-DD')&User) as [DeviceID],
// Date(Date#([Bill Date],'DD-MMM-YY'),'YYYY-MM-DD') as BillDate
//;
LOAD
[Client Number],
[Bill Date],
[Billing Name],
[Additional Line of Billing Name],
[Purchase Order Number],
[Bill Number],
[Product Type],
User,
[Sub Level A Name],
[Sub Level B Name],
[User Name],
[Additional User Name],
[Reference 1],
[Reference 2],
0 as Adjustments,
0 as [Adjusted HST],
0 as [Adjusted PST/QST],
0 as [Adjusted GST],
'' as [Service Plan Name],
0 as [Service Plan Price],
0 as [Additional Local Airtime],
0 as [Over/Under],
0 as [Contribution to Pool],
0 as [Phone Long Distance Charges],
0 as [Private/Group Long Distance Charges],
0 as [Roaming Charges],
0 as [Data and Other Services],
0 as [Voice Services],
0 as [Pager Services],
0 as [Value Added Services],
// [Other Charges and Credits],
0 as [Network and Access],
0 as [HST - BC],
0 as [HST - AB],
0 as [HST - SK],
0 as [HST - MB],
// [HST - ON],
0 as [HST - PE],
0 as [HST - NB],
0 as [HST - NS],
0 as [HST - NT],
0 as [HST - NF],
0 as [HST - PQ],
0 as [HST - YT],
0 as [HST - NU],
0 as [PST - BC],
0 as [PST - AB],
0 as [PST - SK],
0 as [PST - MB],
0 as [PST - ON],
0 as [PST - PE],
0 as QST,
0 as [Subtotal before GST],
0 as GST,
0 as [Total Current Charges],
0 as [Total Charges and Adjustments]
FROM
[$(vFileName)]
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq)
WHERE([Other Charges and Credits] <> '0');
Try modifing if statement like
if $(vFileExsist) = -1 then
your code
Else
Exit Script;
End If;