Problem in Filling elements in Array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abid The Arch
    New Member
    • Jul 2007
    • 2

    Problem in Filling elements in Array

    I work on Datastage(Dataw arehousing tool) where C code is used in one of the stages.Input comes from DB2 stage with 2463 rows which is taken in following structure.But,w hen final "rcnt" is taken,only half the count(1231) can be seen.
    I am now confused as why its happening.Can anybody help me in the same?

    struct gui_rec {
    int win_id;
    string app_name;
    string exe;
    string win_title;
    string rule1;
    string rule2;
    int type;
    } gui_array[5000];

    int rcnt=0;
    readRecord(1);
    while (!inputDone(1))
    {
    gui_array[rcnt].win_id=InLkp.W INDW_ID;
    gui_array[rcnt].app_name=InLkp .APP_NAME;
    gui_array[rcnt].exe=InLkp.EXE;
    gui_array[rcnt].win_title=InLk p.WINDW_TITLE_T EXT;
    gui_array[rcnt].rule1=InLkp.RU LE1;
    gui_array[rcnt].rule2=InLkp.RU LE2;
    gui_array[rcnt++].type=InLkp.TYP E;
    readRecord(1);

    }
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by Abid The Arch
    I work on Datastage(Dataw arehousing tool) where C code is used in one of the stages.Input comes from DB2 stage with 2463 rows which is taken in following structure.But,w hen final "rcnt" is taken,only half the count(1231) can be seen.
    I am now confused as why its happening.Can anybody help me in the same?

    struct gui_rec {
    int win_id;
    string app_name;
    string exe;
    string win_title;
    string rule1;
    string rule2;
    int type;
    } gui_array[5000];

    int rcnt=0;
    readRecord(1);
    while (!inputDone(1))
    {
    gui_array[rcnt].win_id=InLkp.W INDW_ID;
    gui_array[rcnt].app_name=InLkp .APP_NAME;
    gui_array[rcnt].exe=InLkp.EXE;
    gui_array[rcnt].win_title=InLk p.WINDW_TITLE_T EXT;
    gui_array[rcnt].rule1=InLkp.RU LE1;
    gui_array[rcnt].rule2=InLkp.RU LE2;
    gui_array[rcnt++].type=InLkp.TYP E;
    readRecord(1);

    }

    Hi,
    First try to print the count inside the for loop and check whether the ip has that many number of records.
    I dont find any issues in the code

    Raghuram

    Comment

    • Abid The Arch
      New Member
      • Jul 2007
      • 2

      #3
      The problem is solved.
      It was in one of the stages in Datastage,the tool and not in the C code.

      Comment

      Working...