Focal Point
[SOLVED] Removing blank Column spaces

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4491089203

October 17, 2008, 10:04 AM
Mayor
[SOLVED] Removing blank Column spaces
Hello There,

I am using the following command:

ON TABLE HOLD AS MATESTHLD FORMAT DFIX DELIMITER .

My out result is:

Column1. .Column3.Column4

What I need as an Output is

Column1..Column3.CoLumn4

I dont wont to pass anything through for any empty columns and having spaces for them throws it all off

Any ideas?

Thanks

This message has been edited. Last edited by: Kerry,



Production & Development: WebFocus 7.6.4
October 17, 2008, 10:40 AM
<JG>
COMPUTE COLUMN2/A10 MISSING ON= IF COLUMN2 EQ ' ' THEN MISSING ELSE COLUMN2;
October 17, 2008, 11:33 AM
jfr99
Here's an example using the CAR file.

Look at the defined field N4_TEXT. Is that what you want?

-*-------------------------------------------------------
DEFINE FILE CAR
T_KEY/I3 WITH MODEL = T_KEY + 1;
-*
T_TEXT/A50 = DECODE T_KEY (
1 'Column1Column2Column3Column4'
2 'Column1 Column3Column4'
3 'Column1Column2Column3 '
4 'Column1 Column4'
5 ' Column2Column3Column4'
6 ' Column4'
7 ' '
8 ' Column3Column4'
ELSE '');
-*
T_COL1/A7 = EDIT(T_TEXT,'9999999');
T_COL2/A7 = EDIT(T_TEXT,'$$$$$$$9999999');
T_COL3/A7 = EDIT(T_TEXT,'$$$$$$$$$$$$$$9999999');
T_COL4/A7 = EDIT(T_TEXT,'$$$$$$$$$$$$$$$$$$$$$9999999');
-*
N1_TEXT/A07 = IF T_COL1 EQ ' ' THEN '' ELSE T_COL1;
N2_TEXT/A15 = IF T_COL2 EQ ' ' THEN N1_TEXT ELSE (IF N1_TEXT EQ ' ' THEN T_COL2 ELSE N1_TEXT || '.' || T_COL2);
N3_TEXT/A23 = IF T_COL3 EQ ' ' THEN N2_TEXT ELSE (IF N2_TEXT EQ ' ' THEN T_COL3 ELSE N2_TEXT || '.' || T_COL3);
N4_TEXT/A31 = IF T_COL4 EQ ' ' THEN N3_TEXT ELSE (IF N3_TEXT EQ ' ' THEN T_COL4 ELSE N3_TEXT || '.' || T_COL4);
END
-*
TABLE FILE CAR
PRINT
T_KEY
T_TEXT
-*
T_COL1
T_COL2
T_COL3
T_COL4
-*
N4_TEXT
WHERE RECORDLIMIT EQ 8
END
-*-------------------------------------------------------

Jim


WebFocus 8.201M, Windows, App Studio
October 17, 2008, 11:50 AM
Mayor
Looking at what JG and you have posted....I realized I need something as simple as:

SET NODATA='';

Since, I am trying to apply this to a number of columns and DEFINE FILE would be quite tiresome not just for now, but for future debuggin.

However, I can not seem to get the NODATA to work...Can you explain this and provide me a solution (that is NODATA related)?


Thanks,



Production & Development: WebFocus 7.6.4
October 17, 2008, 12:04 PM
<JG>
quote:
SET NODATA='';

Have you really got nodata.

If you are working with hold files then you have to propogate the missing attributes to
the hold files otherwise it will substitute spaces and 0's.

look at SET HOLDMISS = ON and look at the documentation 'Preserving Missing Data Values in an Output File'
October 17, 2008, 12:17 PM
Mayor
Got it to work with the SET HOLDMISS=ON

THANKS!!



Production & Development: WebFocus 7.6.4