473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Problem in Filling elements in Array

I work on Datastage(Datawarehousing 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,when 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.WINDW_ID;
gui_array[rcnt].app_name=InLkp.APP_NAME;
gui_array[rcnt].exe=InLkp.EXE;
gui_array[rcnt].win_title=InLkp.WINDW_TITLE_TEXT;
gui_array[rcnt].rule1=InLkp.RULE1;
gui_array[rcnt].rule2=InLkp.RULE2;
gui_array[rcnt++].type=InLkp.TYPE;
readRecord(1);

}
Jul 5 '07 #1
2 1303
gpraghuram
1,275 Expert 1GB
I work on Datastage(Datawarehousing 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,when 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.WINDW_ID;
gui_array[rcnt].app_name=InLkp.APP_NAME;
gui_array[rcnt].exe=InLkp.EXE;
gui_array[rcnt].win_title=InLkp.WINDW_TITLE_TEXT;
gui_array[rcnt].rule1=InLkp.RULE1;
gui_array[rcnt].rule2=InLkp.RULE2;
gui_array[rcnt++].type=InLkp.TYPE;
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
Jul 5 '07 #2
The problem is solved.
It was in one of the stages in Datastage,the tool and not in the C code.
Jul 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: luigi | last post by:
Hi, I am trying to speed up the perfomance of stl vector by allocating/deallocating blocks of memory manually. one version of the code crashes when I try to free the memory. The other version...
8
by: Sowen | last post by:
Hi, I have an object "elem", there are only simple functions inside, like setName, getName, and three constructors Now I have another class "Base", need an array of elem to initialize class...
24
by: Bangalore | last post by:
Hi all, I have a problem in accessing elements using overloaded operator . Consider, const int SIZE=10; int FALSE=0; class Array { private: int x; public:
5
by: John Salerno | last post by:
I might decide to use a 3D array, but for now I'm experimenting with 2D. Here's what I have so far: for (int x = 0; x < 10; x++) { for (int y = 0; y < 10; y++) { panelOne = switches; } }
12
by: pjhyett | last post by:
standard 2d array filling with increasing numbers for rows and columns: for(int i=0;i<n;i++) for(int j=0;j<n;j++) a = i + j; problem is it's O(n^2). I'm looking for a method to decrease the...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
2
by: laredotornado | last post by:
Hello, I am trying to parse a CSV file. I am counting on the fact that there will be 10 entries per row while (($data = fgetcsv($handle, 1000, ",")) != FALSE) { but that is not always...
2
by: manontheedge | last post by:
I'm having trouble coming up with code to fill an array... dim x as variant dim y as variant x = "fill the array" for count = 1 to 3 y(count) = x(count)
3
by: Vasu | last post by:
Hi! Can anybody there help me in analysis of the following code, which is a structure of customer's details, asks user to fill in the no. of customers and then their details. When I put in no. of...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.