Focal Point
Embded Carriage Control In Hold Files

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

September 07, 2007, 09:24 AM
Edan
Embded Carriage Control In Hold Files
The problem I have is that in Sybase I have an alpha field. Embedded within this field on some records is a carriage return, line feed (CRLF) combination. When I table the file into a hold file, the embedded CRLF is stored. Any subsequent tables against the hold file give errors. The reason this happens is that WebFOCUS considers CRLF to mean the start of a new record. Of course at this point the data is out of alignment with the master, thus causing errors.

The only solution I've been given is to use a string replace to remove the offending charachters. This of course means I would not be able to load Sybase with alpha containing CRLF's. I would also have to guess which fields might potentially have such CRLF combinations even if my test data does not.

On the mainframe version of Focus, this was never a problem. The reason was those hold files were held as fixed format files. When you created a HOLD file with the embedded CRLF, Focus would not care since it counted the number of bytes in the fixed format file. WebFOCUS seems to only CREATE variable length hold files, thus a CRLF causes WebFOCUS to think a NEW record has started as opposed to being a legitimate data value. What I really need to know is how I can get WebFOCUS to create hold files WITH fixed record lengths.
September 07, 2007, 10:33 AM
hammo1j
You have to use ON TABLE HOLD FORMAT BINARY or there is a SET HOLDFORMAT=BINARY which will issue a FILEDEF holdname DISK holdname.ftm RECFM F LRECL nnn on your behalf getting round this problem.

I've ranted in other threads about this problem because there is no explanation of the exact behaviour on encountering CR LF in format alpha masters ie does it clear the buffer before reading in the rest of the record up to the CR LF.

Interestingly HOLD FORMAT XFOCUS might solve your problem as well and in 7.6.2 where the internal matrix is copied will probably be the fastest!



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
September 08, 2007, 11:05 AM
susannah
Edan
use the BYTVAL function to determine the value of your crlf character. You'll actually have to copy and paste it into the BYTVAL function..they seem to appear as a little square box...which can represent several different BYTVALs.
Then CTRAN out that paraticular value into some other temporary value (like a pipe?) that won't cause a problemwith a hold file.
Then CTRAN it right back when you want to reload your SYBASE, if i understand your task correctly.
If you want that CRLF to actually differentiate fields, you can dump your column containing the CRLF into a flat file which you then read back with a DFIX master , such as
FILE=BMSFAKE        ,SUFFIX=DFIX  
$$ use this master in stetlbms.fex to run that component field into fields
SEGNAME=BMSFAKE ,SEGTYPE=S0         
FIELDNAME=STYLE,,A8,$
FIELDNAME=DIV,,A2,A2,$
FIELDNAME   =FAKE1               ,E01         ,A150     ,A150     ,$   
FIELDNAME   =FAKE2               ,E01         ,A150     ,A150     ,$   
FIELDNAME   =FAKE3               ,E01         ,A150     ,A150     ,$
FIELDNAME   =FAKE4               ,E01         ,A150     ,A150     ,$    
FIELDNAME=DELIMITER,ALIAS = '', A1,A1,$

hmm the little square box character that is in between the '' in the DELIMITER isn't showing up on this board... That little square box is the ascii manifestation of the crlf.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID