Forum Stats

  • 3,767,923 Users
  • 2,252,730 Discussions
  • 7,874,381 Comments

Discussions

No. of Rows Control data match with target data in FDMEE

Rabi P
Rabi P Member Posts: 32
edited Apr 3, 2018 3:45AM in Financial Data Management

Hi All,

   My client has got an unique requirement. They want to load a control file in FDMEE that will contain the total number of rows count in source file. Their expectation is that FDMEE should read that info from control file and should count the total number of data loaded in target and compare whether the row count in control file matches with the actual number of rows loaded. I am not sure how  to implement that.

Anybody who has implemented anything similar, kindly guide me

Regards

Rabi

Tagged:

Answers

  • Srini+K
    Srini+K Member Posts: 253 Blue Ribbon
    edited Mar 30, 2018 8:32AM

    not sure this method of control file carrying count is valid concept in FDMEE sense.   FDM can generate that count for you (scripting?).   Carrying count and data is a standard practice in flat file based systems (Mainframe, etc.).  FDM validates each record and reports can be generated, conditions can be tested etc. inside scripting..

    being said that.. have a script written to generate a report with count in FDMEE.. and then match that with diff or similar os tool to match your source control file.  Generate exception where they do not match.

    Thanks

  • Francisco Amores
    Francisco Amores Member Posts: 1,693 Bronze Crown
    edited Apr 2, 2018 8:50AM

    Hi,

    My client has got an unique requirement. They want to load a control file in FDMEE that will contain the total number of rows count in source file.

    why they want to load that into FDMEE? wouldn't be enough for FDMEE to access it to read total number of rows?

    Their expectation is that FDMEE should read that info from control file and should count the total number of data loaded in target and compare whether the row count in control file matches with the actual number of rows loaded

    You want to match against total # of lines loaded into target? or total # of rows imported into FDMEE? I say that because FDMEE loads data aggregated based on mapped data. Therefore, your # of lines loaded into the target is usually lower than the # of lines you import into FDMEE

    . I am not sure how  to implement that.

    Let's assume you want to match # of lines loaded into target against # of lines in your control file.

    You could write an event script (BefExportToDat) where you get the total # of lines loaded by querying the SQL view AIF_HS_BALANCES (SELECT COUNT(*) FROM AIF_HS_BALANCES where LOADID = ?). then you read the number of lines from the control file and you compare it. You can do whatever you want based on your result

    Anybody who has implemented anything similar, kindly guide me

  • User_7EQ9Q
    User_7EQ9Q Member Posts: 142 Blue Ribbon
    edited Apr 3, 2018 3:45AM

    Hi Rabi,

    Our source file contains the count in last line as below

    Line count: 1555364  .      .      .      .      .      .      .      .      .      .

    The working script which we have in "Import" is as follows, check if this helps.

    cont = 0def File_count(strfield, strrecord):    global cont    cont = cont + 1    linecount = 0            if strrecord[:11] == 'Line count:':        footer = strrecord.split(':')        fdmAPI.logInfo('Footer is: %s' % footer[1])        linecount = footer[1].strip().replace('.','').replace('\t','')        fdmAPI.logInfo('Linecount is: %s' % linecount)        cont = cont - 1  # Remove the Footer        if int(linecount) == cont:            fdmAPI.logInfo('File Validation count successful, number of lines: %s'                            % linecount)        else:            fdmAPI.logError('File Validation count failed, expected %s vs count %s'                             % (linecount, cont))            errorFlagFile = '%s/logs/%s_%s_valerr.flg' \                % (fdmContext['OUTBOXDIR'], fdmContext['TARGETAPPNAME'                   ], fdmContext['LOADID'])            fdmAPI.logInfo('%s' % errorFlagFile)            flagFile = open(errorFlagFile, 'w')            flagFile.write('File Validation count failed, expected %s vs count %s'                            % (linecount, cont))            flagFile.close()        return strfield

    Thanks

    A

This discussion has been closed.