Function SAP_Analysis(Void)

#pragma precomp SRP_PreCompiler

$insert LOGICAL

BaseNumber      = 'M010946'

SAPBatch        = BaseNumber : '.5'
TSVFilesFolder  = 'E:\apps\SAP\FTPFiles\'
InitDir TSVFilesFolder : '*.tsv'
Files           = DirList()
TSVFileFound    = False$
For Each File in Files using @FM
    OSRead FileData from TSVFilesFolder : File then
        If Index(FileData, SAPBatch, 1) then TSVFileFound = True$
    end
Next File

ProdOrdNo       = BaseNumber : '.1'
CassCompFolder  = 'E:\apps\LogFiles\SAP\'
InitDir CassCompFolder : '*.csv'
Files           = DirList()
CSVFileFound    = False$
For Each File in CassCompFolder : Files using @FM
    OSRead FileData from File then
        If Index(FileData, ProdOrdNo, 1) then CSVFileFound = True$
    end
Next File

Ans = 'TSV Found = ' : TSVFileFound : ', CSV Found = ' : CSVFileFound

Return Ans OR ''
