Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have written this Sub in a sheet:
sub FilesLoad(Root,FileName,RunIdList)
let vTableName = '$(FileName)';
let vRunList = '$(RunIdList)';
let vConcatenate = ;
sub ScanFolder(Root)
for each FoundFile in filelist( Root & '\*.csv')
if(match(subfield('$(FoundFile)','\',-3), '$(vRunList)')) then
if (match(upper(left(mid('$(FoundFile)', index('$(FoundFile)', '\', -1) +1), len(mid('$(FoundFile)', index('$(FoundFile)', '\', -1) +1)) -19)),'$(vTableName)')) then
$(vTableName):
$(vConcatenate)
LOAD *
FROM '$(FoundFile)' (txt, codepage is 1252, no labels, delimiter is '|', msq);
endif
Set vConcatenate = Concatenate;
ENDIF
next FoundFile
for each SubDirectory in dirlist( Root & '\*' )
call ScanFolder(SubDirectory)
next SubDirectory
STORE '$(vTableName)' into 'C:\test\$(vTableName).qvd' (qvd);
end sub
call ScanFolder(Root)
end Sub
then in the previous script I call this sub:
let vRoot = 'C:\decisioning\log\dcs';
call FilesLoad('$(vRoot)','DCS_META_DATA','1')
and I get:
Script line error:
call FilesLoad('C:\decisioning\log\dcs','DCS_META_DATA','1')
Can someone assist?
thanks,
Boris
What do you mean with 'previous script'?
I believe you can only CALL as SUB if your script execution already passed the SUB definition.
What do you mean with 'previous script'?
I believe you can only CALL as SUB if your script execution already passed the SUB definition.
You need to define the subroutine ScanFolder first.
Then you can call this in the FilesLoad subroutine.