xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
If the problem is "some bug", then the solution is "change some code".

If you want a more helpful answer, give a more helpful problem description. Read the link in my sig.
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Code:
 int Generate_SA_Report(
			char* startDate, 
			char* endDate, 
			struct parameters* parms) 
{ 	
	/***************************************************
	 * Preparation 
	 ***************************************************/ 
	/* Variable declaration */ 
	int skipLotCntr = 0; 
	int numOfFiles = 0; 
	int compQty = 0; 
	int indexOfComp = 0; 
	int indexOfCarHistRecord = 0; 

	vc2_LotSK lot_sk; 
	vc2_TxnSK txn_sk; 	
	vc2_Operation action; 
	vc2_LotId lot; 
	vc2_StepId stepId; 	
	vc2_StepId sorterAction; 
	vc2_Stage stage; 
	vc2_Recipe recipe; 
	vc2_Operation operation; 
	vc2_Operation subOperation; 
	vc2_WaferQty qtyIn; 
	vc2_WaferQty qtyOut; 
	vc2_WaferQty actualQty; 
	vc2_EqpId eqpId; 
	vc2_Device device; 
	vc2_Technology tech; 
	vc2_DateTime toTime; 
	vc2_DateTime tiTime; 
	vc2_DateTime createTime;  
	vc2_UserId employee; 
	vc2_CarrierId carrierId; 
	vc2_LotId finalLotId; 
	vc2_GroupHistKey groupHistKey; 
	vc2_PlanId planId; 	
	vc2_SlotPosition slot; 
	vc2_CarrierId origCass; 
	vc2_VScriberId inHouseScribe; 
	vc2_VScriberId vendorScribe; 
    vc2_VScriberId POSITION;
	vc2_CarrierId finalCass; 
	vc2_SlotPosition origSlotArray[MAX_WAFERQTY_PER_LOT]; 
	vc2_CarrierId origCassArray[MAX_WAFERQTY_PER_LOT]; 
	vc2_VScriberId inHouseScribeArray[MAX_WAFERQTY_PER_LOT];  
	vc2_VScriberId vendorScribeArray[MAX_WAFERQTY_PER_LOT];
    vc2_VScriberId POSITIONArray[MAX_WAFERQTY_PER_LOT];
	vc2_SlotPosition finalSlotArray[MAX_WAFERQTY_PER_LOT]; 
	vc2_CarrierId finalCassArray[MAX_WAFERQTY_PER_LOT]; 
	
	vc2_VScriberId scribeId;
	vc2_SysId carHistSysId; 
	vc2_SysId carHistTxnTime; 
	vc2_SysId carHistSysIdArray[MAX_CARHISTRECORD_NUM];	 
	vc2_SysId carHistTxnTimeArray[MAX_CARHISTRECORD_NUM]; 
	int finalFlag = FALSE; 
	char currDateTime[20]; 
	char* pTmp = NULL; 

	/* Reset memory */ 
	memset(scribeId, 0, sizeof(scribeId)); 
	memset(currDateTime, 0, sizeof(currDateTime)); 
	memset(carHistSysId, 0, sizeof(carHistSysId)); 	
	memset(carHistTxnTime, 0, sizeof(carHistTxnTime)); 	
	memset(carHistSysIdArray, 0, sizeof(carHistSysIdArray)); 
	memset(carHistTxnTimeArray, 0, sizeof(carHistTxnTimeArray)); 
	
	#ifdef DEBUG 
	printf("%s: Start to retrieve Sorter Action Information\n", GetCurrDateTime(currDateTime)); 			
	printf("  Start Date [%s] ~ End Date [%s]\n", startDate, endDate); 	
	#endif 
	
	/***************************************************
	 * Query data  
	 ***************************************************/ 
	/* Get 'Sorter Action' lot (lot_sk, txn_sk) list */ 
	EXEC SQL DECLARE wsSaCursor CURSOR FOR
			  SELECT wip.lot_sk, wip.txn_sk 
			    FROM hdbxuser.fwhdbwipstephistory@hdbsil sh, 
			  	     hdbxuser.fwhdbwiptransaction@hdbsil wip 
			   WHERE wip.wipstep_sk = sh.wipstep_sk 
			     AND wip.activity = 'TrackIn' 
			     AND wip.txntime = sh.trackintime 
			     AND sh.trackouttime BETWEEN :startDate AND :endDate; 
	
	/* Open cursor */ 
	EXEC SQL OPEN wsSaCursor;
 
	/* Loop, fetching all salesperson's statistics.
	 * Cause the program to break the loop when no more
	 * data can be retrieved on the cursor.
	 */	
	EXEC SQL WHENEVER NOT FOUND DO break; 
	
	for( ; ;) 
	{	
		/* Reset memory */ 		
		memset(lot_sk, NULL, sizeof(lot_sk)); 
		memset(txn_sk, NULL, sizeof(txn_sk)); 	
		memset(action, NULL, sizeof(action)); 
		memset(lot, NULL, sizeof(lot)); 
		memset(stepId, NULL, sizeof(stepId)); 
		memset(sorterAction, NULL, sizeof(sorterAction)); 
		memset(stage, NULL, sizeof(stage)); 
		memset(recipe, NULL, sizeof(recipe)); 	
		memset(operation, NULL, sizeof(operation)); 
		memset(subOperation, NULL, sizeof(subOperation)); 
		memset(qtyIn, NULL, sizeof(qtyIn));
		memset(qtyOut, NULL, sizeof(qtyOut));
		memset(actualQty, NULL, sizeof(actualQty)); 
		memset(eqpId, NULL, sizeof(eqpId)); 
		memset(device, NULL, sizeof(device)); 
		memset(tech, NULL, sizeof(tech)); 
		memset(toTime, NULL, sizeof(toTime)); 
		memset(tiTime, NULL, sizeof(tiTime)); 
		memset(createTime, NULL, sizeof(createTime));  
		memset(employee, NULL, sizeof(employee)); 
		memset(carrierId, NULL, sizeof(carrierId)); 
		memset(finalLotId, NULL, sizeof(finalLotId)); 
		memset(groupHistKey, NULL, sizeof(groupHistKey)); 
		memset(planId, NULL, sizeof(planId)); 
		memset(origSlotArray, NULL, sizeof(origSlotArray)); 
		memset(origCassArray, NULL, sizeof(origCassArray)); 
		memset(inHouseScribeArray, NULL, sizeof(inHouseScribeArray)); 
		memset(POSITIONArray,NULL,sizeof(POSITIONArray)); 
		memset(vendorScribeArray, NULL, sizeof(vendorScribeArray)); 
		memset(finalSlotArray, NULL, sizeof(finalSlotArray)); 
		memset(finalCassArray, NULL, sizeof(finalCassArray)); 
		
		/* Get txn_sk */ 
		EXEC SQL FETCH wsSaCursor INTO :lot_sk, :txn_sk;
				
		/* Skip it if no data found  */
		EXEC SQL WHENEVER NOT FOUND GOTO NOTFOUND; 
    
		/* To check whether the lot perform 'Sorter Action' or not */   
		EXEC SQL  SELECT LOWER (recipe), transportid, stage, device 
		            INTO :recipe, :carrierId, :stage, :device 
							  FROM (SELECT lotrecipe.attrvalue recipe,
							               lottransportid.attrvalue transportid, lotstage.attrvalue stage,
							               lotdevice.attrvalue device
							          FROM hdbxuser.fwhdbwiplotattrinstance@hdbsil lotrecipe,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lotstage,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lottransportid,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lotdevice
							         WHERE lotrecipe.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotrecipe.startsequence AND lotrecipe.stopsequence
							           AND lotrecipe.attrname = 'Recipe'
							           AND (   LOWER (lotrecipe.attrvalue) LIKE '%verify%'
							                OR (LOWER (lotrecipe.attrvalue) LIKE '%random%')
							                OR (LOWER (lotrecipe.attrvalue) LIKE '%reorder%')
							               )
							           AND lotstage.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotstage.startsequence AND lotstage.stopsequence
							           AND lotstage.attrname = 'Stage'
							           AND lottransportid.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lottransportid.startsequence
							                           AND lottransportid.stopsequence
							           AND lottransportid.attrname = 'transportId'
							           AND lotdevice.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotdevice.startsequence AND lotdevice.stopsequence
							           AND lotdevice.attrname = 'partProgId'
							        UNION ALL
							        SELECT lotsorteraction.attrvalue recipe,
							               lottransportid.attrvalue transportid, lotstage.attrvalue stage,
							               lotdevice.attrvalue device
							          FROM hdbxuser.fwhdbwiplotattrinstance@hdbsil lotsorteraction,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lotstage,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lottransportid,
							               hdbxuser.fwhdbwiplotattrinstance@hdbsil lotdevice
							         WHERE lotsorteraction.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotsorteraction.startsequence
							                           AND lotsorteraction.stopsequence
							           AND lotsorteraction.attrname = 'SorterAction'
							           AND lotsorteraction.attrvalue IN ('REORDER', 'VERIFY')
							           AND lotstage.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotstage.startsequence AND lotstage.stopsequence
							           AND lotstage.attrname = 'Stage'
							           AND lottransportid.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lottransportid.startsequence
							                           AND lottransportid.stopsequence
							           AND lottransportid.attrname = 'transportId'
							           AND lotdevice.lot_sk = :lot_sk
							           AND :txn_sk BETWEEN lotdevice.startsequence AND lotdevice.stopsequence
							           AND lotdevice.attrname = 'partProgId'); 	
							
		/* Get lot detail information */ 
		EXEC SQL  SELECT wipin.lotid, wipout.userid, wipin.txntime, wipin.lotqtyout,
							       wipout.txntime totime, wipout.lotid finallotid, wipin.grouphistkey,
							       sh.LOCATION, sh.stepid, sh.planid, sh.productname tech, 
							       lot.createtxntime 
							  INTO :lot, :employee, :tiTime, :actualQty, :toTime, :finalLotId, :groupHistKey, 
							  	   :eqpId, :stepId, :planId, :tech, :createTime 
							  FROM hdbxuser.fwhdblot@hdbsil lot,
							       hdbxuser.fwhdbwipstephistory@hdbsil sh,
							       hdbxuser.fwhdbwiptransaction@hdbsil wipout,
							       hdbxuser.fwhdbwiptransaction@hdbsil wipin
							 WHERE lot.lot_sk = wipin.lot_sk
							   AND wipout.grouphistkey = wipin.grouphistkey
							   AND wipout.activity = 'TrackOut'
							   AND sh.wipstep_sk = wipout.wipstep_sk
							   AND wipin.txn_sk = :txn_sk; 
		
		/* Get component Id list */ 
		EXEC SQL DECLARE comp_Cursor CURSOR FOR 
		          SELECT lot.lotid || '.' || comp.POSITION inhousescribe,
			         comp.componentid vendorscribe,
                     comp.POSITION				  
				    FROM hdbxuser.fwhdblot@hdbsil lot,
				         hdbxuser.fwhdbwipcomponent@hdbsil comp
				   WHERE lot.lot_sk = comp.originallot_sk
				     AND comp.lot_sk = :lot_sk
				     AND :txn_sk BETWEEN startsequence AND stopsequence 
				     AND comp.status <> 'Scrapped'
				     ORDER BY comp.componentid; 
		
		EXEC SQL OPEN comp_Cursor; 
		EXEC SQL WHENEVER NOT FOUND DO break; 
		
		indexOfComp = 0;
		for(; ;) 
		{ 
			memset(inHouseScribe, NULL, sizeof(inHouseScribe)); 
			memset(vendorScribe, NULL, sizeof(vendorScribe));
            memset (POSITION,NULL,sizeof (POSITION));
			
			EXEC SQL FETCH comp_Cursor INTO :inHouseScribe, :vendorScribe, :POSITION;		
			strcpy(inHouseScribeArray[indexOfComp], inHouseScribe); 
			strcpy(vendorScribeArray[indexOfComp], vendorScribe); 
            strcpy (POSITIONArray[indexOfComp],POSITION);
			indexOfComp++; 
		} 	
		compQty = indexOfComp; 
		EXEC SQL CLOSE comp_Cursor; 
		
		/* 
		 * The following is to retrieve component Id slot-map 
		 * information: orignal -- final position 
		 * 
		 * 1. Get SysId/TxnTime list from FwCarrierHistory in desc order; 
		 *    Time range: create time ~ to time 
		 *    SysId list is stored in an array that size is 10. 
		 * 2. Loop: wafer by wafer 
		 *    2.1 Get final position (FwCarrierHistory_PN2M) 
		 *        2.1.1 Make sure TxnTime is between TiTime and ToTime 
		 *        2.1.2 Get final position by using the lastest sysId 
		 *    2.2 Get original position  by using the latest SysId; 
		 *        2.2.1 Make sure TxnTime is earlier TiTime. 
		 *              If not, skip to previous record (SysId); 
		 *        2.2.2 Get original position by using SysId. If not found, 
		 *              skip to previous record (SysId) 
		 */ 		
		
		/* VERY IMPORTANT */ 
		/* Minus 1 min (60 seconds) to create time */ 
		/* We may fail to get data if using create time in some cases  
		 * because CARRIER transaction is done eariler than WIP. 
		 * For example, one child is created (split) in '20090806 152152000', 
		 * but the Assign Component happen in 20090806 152151000
		 */ 		
		AddSeconds( createTime, -60 ); 
		
		/* Get SysId/TxnTime list from FwCarrierHistory */ 
		EXEC SQL DECLARE carhist_Cursor CURSOR FOR 
					SELECT   sysid, txntime 
						FROM caruser.fwcarrierhistory
					   WHERE carrierid = :carrierId
						 AND activity IN
								('FwCarrierAssignComponentTxn',
								 'FwCarrierModifyComponentPositionTxn',
								 'ReAssociateTo'
								)
						 AND txntime BETWEEN :createTime AND :toTime 
					ORDER BY txntime DESC; 

		EXEC SQL OPEN carhist_Cursor; 
		EXEC SQL WHENEVER NOT FOUND DO break; 
				
		memset(carHistSysIdArray, 0, sizeof(carHistSysIdArray)); 
		memset(carHistTxnTimeArray, 0, sizeof(carHistTxnTimeArray)); 
		
		for(indexOfCarHistRecord = 0; indexOfCarHistRecord < MAX_CARHISTRECORD_NUM; indexOfCarHistRecord++) 
		{ 	
			memset(carHistSysId, 0, sizeof(carHistSysId)); 	
			memset(carHistTxnTime, 0, sizeof(carHistTxnTime)); 	
			
			EXEC SQL FETCH carhist_Cursor INTO :carHistSysId, :carHistTxnTime;  			
			strcpy(carHistSysIdArray[indexOfCarHistRecord], carHistSysId); 
			strcpy(carHistTxnTimeArray[indexOfCarHistRecord], carHistTxnTime); 	
		} 	
		EXEC SQL CLOSE carhist_Cursor; 							
		
		/* To get final & original position for each wafer */ 					
		for (indexOfComp = 0; indexOfComp < compQty; indexOfComp++) 
		{ 
			finalFlag = FALSE; 
			memset(scribeId, NULL, sizeof(scribeId)); 
			strcpy(scribeId, vendorScribeArray[indexOfComp]); 
			
			/* Loop: to find original-final slot position */ 
			for(indexOfCarHistRecord = 0; indexOfCarHistRecord < MAX_CARHISTRECORD_NUM; indexOfCarHistRecord++) 
			{ 
				memset(slot, NULL, sizeof(slot)); 
				memset(carHistSysId, 0, sizeof(carHistSysId)); 
				
				strcpy(carHistSysId, carHistSysIdArray[indexOfCarHistRecord]); 
				
				EXEC SQL WHENEVER NOT FOUND CONTINUE;
				
				EXEC SQL  	SELECT valdata slot 
							  INTO :slot 
							  FROM caruser.fwcarrierhistory_pn2m
							 WHERE fromid = :carHistSysId AND linkname = 'components'
					         AND keydata = :scribeId; 			
				
				if (strlen(slot) > 0) 				
				{ 
					if (strcmp(carHistTxnTimeArray[indexOfCarHistRecord], tiTime) > 0) 
					{ 
						/* Finalflag is to make sure to get the correst slot position (latest).  
						 * To handle abnormal case: namely that there are multiple slot 
						 * mapping changes during the period of Track-In and Track-Out. 
						 */ 						
						if (finalFlag == FALSE) 
						{ 
							/* Final position */ 
							strcpy(finalSlotArray[indexOfComp], slot); 
							strcpy(finalCassArray[indexOfComp], carrierId); 
						
							finalFlag = TRUE; 
						} 
					} 
					else 
					{ 
						/* Original position */ 
						strcpy(origSlotArray[indexOfComp], slot); 
						strcpy(origCassArray[indexOfComp], carrierId); 
						
						/* If final position value is NULL, it is assumed that 
						 * the slot position does not change, same as original one */ 
						if (strlen(finalSlotArray[indexOfComp]) == 0) 
						{ 
							strcpy(finalSlotArray[indexOfComp], slot); 
							strcpy(finalCassArray[indexOfComp], carrierId); 
						} 
						
						break; 
					} 
				} 
			} 
		} 
		
		/* Assign value to 'action', 'operation', 'suboperation' */ 
		if (strstr(recipe, "random"))  
		{ 
			strcpy(action, OPERATION_RANDOMIZE); 
			strcpy(operation, stepId); 
			
			/* Strip out XX stage stuff/sortorder in stage name */ 
			pTmp = strchr(stage, ':'); 
			if (pTmp != NULL) 
				strcpy(subOperation, Trim_End(++pTmp)); 
			else 
				strcpy(subOperation, stage); 
		} 
		else if (strstr(recipe, "reorder")) 
		{ 
			strcpy(action, OPERATION_REORDER); 
			strcpy(operation, "reorder"); 
			strcpy(subOperation, "reorder"); 
		} 
		else if (strstr(recipe, "verify")) 
		{ 
			/* 
			if (strstr(stepId, "SorterAction")) 
			{ 
				strcpy(action, OPERATION_VERIFY); 
			} 
			else 
			{ 
				strcpy(action, OPERATION_INLINEVERIFY); 
			} 
			*/ 
			strcpy(action, OPERATION_VERIFY); 
			strcpy(operation, "verify"); 
			strcpy(subOperation, "verify"); 
		} 		
		else 
		{ 			
			strcpy(action, recipe); 
			strcpy(operation, recipe); 
			strcpy(subOperation, recipe); 
		} 
        if ((strlen(inHouseScribeArray[indexOfComp]) !=0)&& (strlen(origSlotArray[indexOfComp]) !=0) && (strlen(origCassArray[indexOfComp]) !=0)&& (strlen(finalCassArray[indexOfComp]) !=0)
            && (strlen(vendorScribeArray[indexOfComp])!=0) && (strlen(finalSlotArray[indexOfComp]) !=0)&& (strlen(POSITIONArray [indexOfComp]) !=0))
        {
                                                    
     	Write_SA_DataFile(startDate, endDate, action, lot, operation, subOperation, 
					actualQty, eqpId, device, tech, toTime, employee, origSlotArray, 
					origCassArray, inHouseScribeArray, vendorScribeArray, finalSlotArray, 
					finalCassArray, parms); 
        }
        
        else 
		{
           Write_PR_DataFile(startDate, endDate, action, lot, operation, subOperation, 
					actualQty, eqpId, device, tech, toTime, employee, origSlotArray, 
					origCassArray, inHouseScribeArray, vendorScribeArray, finalSlotArray, 
  				    finalCassArray, parms); 
        }			
		
		numOfFiles++; 
		#ifdef DEBUG 
		printf("  #%d lot data is extracted\n", numOfFiles); 
		#endif 
		
    continue;
    
NOTFOUND:
		skipLotCntr++; 
		#ifdef DEBUG 
		printf("  #%d lot is skipped\n", skipLotCntr); 
		#endif 
		; 
	} 
	
	/* Close cursor */ 
  EXEC SQL CLOSE wsSaCursor;
  
  #ifdef DEBUG 
  printf("  %d 'Sorter Action' data files are created successfully\n", numOfFiles); 
	printf("%s: Complete retrieving 'Sorter Action' Information\n", GetCurrDateTime(currDateTime)); 		
	#endif 
	
  return(numOfFiles); 
} /* Generate_SA_Report */
The problem here is the data is written to the directory wrongly..The problematic 1 with missing position should written to datafeed.track instead of abnormal data.i put the comp.position as well,
if one of the values is NULL it should go to else statement and write the entire result in abnormaldata directory.but it doesnt do that..
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Again, you're still relying on strlen()==0 to determine if a value is NULL.
This is not valid code. You should use NVL or indicators. For example:

Code:
exec sql declare zz1 cursor for select nvl(foo,'Its NULL Jim') from yyy;
exec sql declare zz2 cursor for select foo from yyy;


exec sql fetch zz1 into :hostvar1;
if (!strcmp(hostvar1,"Its NULL Jim"))
{
  // it's NULL
}
else
{
  // it's not NULL
}

exec sql fetch zz2 into :hostvar2:ind;
if (ind==1) // rtfm for the correct value, not sure 1 is correct
{
  // it's NULL and you don't need to look at hostvar2 *at all*
}
else
{
  // it's not NULL
}
You could also try writing the data out to the debug log just before the if. Write out the content, maybe enclosed in quotes, and the length, e.g.:
Code:
#ifdef DEBUG 
printf("indexOfComp=%d, compQty=%d\n", indexOfComp, compQty); 
printf("inHouseScribeArray[indexOfComp]='%s' length=%d\n",inHouseScribeArray[indexOfComp],strlen(inHouseScribeArray[indexOfComp]));
printforigSlotArray[indexOfComp]='%s' length=%dorigSlotArray[indexOfComp],strlenorigSlotArray[indexOfComp]));
...etc (do each string in the if statement)
#endif 

        if ((strlen(inHouseScribeArray[indexOfComp]) !=0)&& (strlen(origSlotArray[indexOfComp]) !=0) && (strlen(origCassArray[indexOfComp]) !=0)&& (strlen(finalCassArray[indexOfComp]) !=0)
            && (strlen(vendorScribeArray[indexOfComp])!=0) && (strlen(finalSlotArray[indexOfComp]) !=0)&& (strlen(POSITIONArray [indexOfComp]) !=0))
{
...etc
I think this might print some interesting results.
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Dear expert,
I had debug code but where i can find the result since im compiling in the unix environemt.

By clicking make build command and unable see the error..im running in putty application..
debug in putty
Kindly help..

When i write the debug code unable see the result ..what i can do for this case ..
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
I was going by the other debug in the program, i.e.
Code:
  #ifdef DEBUG 
  printf("  %d 'Sorter Action' data files are created successfully\n", numOfFiles); 
	printf("%s: Complete retrieving 'Sorter Action' Information\n", GetCurrDateTime(currDateTime)); 		
	#endif
So you'll find it wherever you find this output. If the process is not running in a terminal and using stdout for the printf statements then try redirecting the output to a file, then you can look in the file.

Of course, it may not be displaying the debug if DEBUG is not defined. To check this try
Code:
#ifdef DEBUG
printf("Debug is enabled\n");
#else
printf("Debug is not enabled\n");
#endif
at the top of the program.
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Dear Expert,

Code:
	#ifdef DEBUG 
    	printf("%s: Start to retrieve 'Create' Information\n", GetCurrDateTime(currDateTime)); 			
    	printf("  Start Date [%s] ~ End Date [%s]\n", startDate, endDate); 	
    	#endif
should i create a function that call the printf statement into the logfile.
Im really stuck..i have no idea how to do this..


Lets say.


Code:
 #ifdef DEBUG 
  printf("  %d 'Sorter Action' data files are created successfully\n", numOfFiles); 
	printf("%s: Complete retrieving 'Sorter Action' Information\n", 
GetCurrDateTime(currDateTime)); 		
	#endif
should i put fprintf statement so that ,it goes into the logfile?
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Code:
#ifdef DEBUG 
    	printf("%s: Start to retrieve Sorter Action Information\n", GetCurrDateTime(currDateTime)); 
       fprintf(stdout,"%s: Start to retrieve Sorter Action Information\n", GetCurrDateTime(currDateTime );			
    	printf("  Start Date [%s] ~ End Date [%s]\n", startDate, endDate); 
       fprintf (stdout,"  Start Date [%s] ~ End Date [%s]\n", startDate, endDate	);
#endif
I dont knoe im rite or not

Last edited by shabbir; 8Apr2011 at 08:20.. Reason: Code blocks
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Code:
I had change the code and and put fprintf  as below

    
   
Code:
 printf("indexOfComp=%d, compQty=%d\n", indexOfComp, compQty); 
    fprintf(fp,"indexOfComp=%d, compQty=%d\n", indexOfComp, compQty);
    printf("inHouseScribeArray[indexOfComp]='%s' length=%d\n",inHouseScribeArray[indexOfComp],strlen(inHouseScribeArray[indexOfComp]));
    fprintf(fp,"inHouseScribeArray[indexOfComp]='%s' length=%d\n",inHouseScribeArray[indexOfComp],strlen(inHouseScribeArray[indexOfComp]));
    fclose(fp);
inHouseScribeArray[indexOfComp]='' length=0 indexOfComp=25, compQty=25 inHouseScribeArray[indexOfComp]='' length=0 indexOfComp=25, compQty=25 inHouseScribeArray[indexOfComp]='' length=0
its become blank...im not sure why its become blank ...Anything wrong ...
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
The output when i check back in log file,the length is 0 ,no wonder it jump to the second function...
Why that so?any idea
kirubagari's Avatar, Join Date: Apr 2011
Go4Expert Member
Code:
indexOfComp=25, compQty=25
inHouseScribeArray[indexOfComp]='' length=0
origSlotArray[indexOfComp]='' length=1
origCassArray[indexOfComp]='@20' length=9
finalCassArray[indexOfComp]='' length=0
vendorScribeArray[indexOfComp]='7' length=3
finalSlotArray[indexOfComp]='' length=0
I had fprint all the values and the result as above..
Why some of the values is like above..
Kindly help..cuz im passing down the array