Focal Point
concatenate with blank at end

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

November 29, 2006, 09:40 AM
tomtom
concatenate with blank at end
Hi

I have a rtf text file that I read with a suffix:fix master
containing 1 field

FILE=OffertMall, SUFFIX=FIX
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=FIELD1, ALIAS=FIELD1, USAGE=A256, ACTUAL=A256, $

In a define I would like to concatenate the text (FIELD1) with '")' at the end.
My problem is that sometimes a row from the file ends with a blank,
sometimes it doesn't (Can FOCUS recognize that in a text file ?).
The rows can be of different length.

I need to preserve the last blank in the concatenation when it's there.
I finally write the rows on a new file.
It should look like this when it's done.

abcdefg ")
hijklmn asd s sdasdasd")
jdfjj sdasdas ")
asdadadasda")

Any help appreciated !
regards
/T
November 29, 2006, 01:26 PM
smiths
Concatenate with the | character. This should preserve the trailing spaces. To remove trailing spaces, concatenate with ||.

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
November 29, 2006, 02:20 PM
hammo1j
WF Wont recognise a trailing blank for A256 field because this assumes that all fields are padded out to length 256 with blanks.

If the file is variable length this master will not work. Try a delimited file and A256V type fields since it should recognise cf lf as the end of the record.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
November 29, 2006, 03:28 PM
<lfrerker>
I had to specify variable length in my filedef for blank spaces at the end of my fields to be perserved. I could not get it to work with variable length records when computing/defining the fields so I set the LRECL to my largest record. In my program I actually build a flat file one row at a time appending to my file that I have filedef'd. Here is a snippet of my code -- hope it helps:

FILEDEF EMPSAV DISK /opt/ibi/webfocus/ibi/apps/allhlds/EMPSAV.FTM (LRECL 68 RECFM V


DEFINE FILE EMPHLD
BLSPC1/A1 = ' ';
BLSPC2/A2 = ' ';
BLSPC4/A4 = ' ';
BLSPC15/A15 = ' ';
A_FILLER/A10 = ' ';
B_FILLER/A9 = '000000000';
END
TABLE FILE EMPHLD
PRINT PLAN_NBR NOPRINT
COMPUTE RECID/A61 = PLAN_NBR | BLSPC2 | EMP_SSN | '04' | '1' | EMP_STREET_LINE1 | BLSPC1 ;
BY PLAN_NBR
BY EMP_CODE
BY EMP_SSN
BY PAY_FREQ
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS EMPSAV FORMAT ALPHA
END
December 04, 2006, 10:50 AM
tomtom
Thanks for your suggestions,
but I haven't manage to solve the problem yet.

It should be possible somehow to read a row until cr lf.

regards

/Tomas