Mike,
I agree that the data sounds suspicious, but alas I believe I have covered it. The table is a temp table and has 1 row of data for testing. The table contains data loaded from a directory via the GATEWAY command. (I do an output temp.dat, Dir statement , output screen, then the Gateway command to load the temp.dat data into a table. All seems to work OK .) For testing, I deleted all rows but 1. R>list dir_table Temporary Table: Dir_Table Descr: Temp table holding directory contents No. Column Name Attributes --- ------------------ ------------------------------------------------------ 1 Short_Name Type : TEXT 30 2 File_Ext Type : TEXT 30 3 File_Size Type : TEXT 30 4 File_Date Type : TEXT 30 5 File_Time Type : TEXT 30 6 File_Name Type : TEXT 50 Current number of rows: 1 R>set var x = short_name in dir_table R>sho var x RC090514 R>set var y = (slen(.x)) R>sho var y 8 The above shows a length of 8, which is the expected result. I trace the command file and once the FETCH has executed, the watch variable shows a space in front. I use the modify variable value tool and it indeed does have a space in front. I added the SLEN command and traced and indeed it returns 9. I can use the TRIM, I just have to hope that the space is consistent in all cases then. Thanks -Bob ----- Original Message ----- From: "MikeB" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Thursday, May 14, 2009 9:43:54 AM GMT -06:00 US/Canada Central Subject: [RBASE-L] - Re: Fetch cursor Also, even though you have said you have double and triple checked the data, open the table and write down the data value, then set the field to null and reenter the data manually. This would insure that there are no unprintable chars preceding the value. I have not been able to duplicate your problem, so I am suspicious of the data. Also, how is the data value added to the table to begin with? ----- Original Message ----- From: <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Thursday, May 14, 2009 10:21 AM Subject: [RBASE-L] - Fetch cursor I am writing an app which involves a Declare / Fetch / While routine. It works, however with the following unexpected result. The command: FETCH c100 INTO vedifile INDICATOR ivvar1 WHILE SQLCODE <> 100 THEN --Add path to file name set var vEdiFile = ( 'G :\ Edisoft \Sales\HOME DEPOT WESTCOAST \ recv \' + . vEdiFile ) The above fetch adds a space in front of the value that is fetched into vedifile . During trace I watch the variable vEdiFile and it displays a space as the first character after fetched. I can use the "Modify variable value" tool and confirm that the variable has a space as the first character. I have double and tripled checked that the data in the table does not have a space in front of it. The proceeding command to add the path then creates an invalid file name because of the added space. I have double and tripled checked that the data in the table does not have a space in front of it. Setting a variable to the column in the table at the R> returns a value with no space. I have used Cursors on tables many, many times and have never seen this before! I am at a loss to figure it out. All variables are predefined before the While statement. Has any one seen this happen or have any ideas what I might be missing? Version V8. Thanks, -Bob

