Focal Point
CR vs. CRLF in SAVE file

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

October 09, 2007, 04:29 PM
Alan
CR vs. CRLF in SAVE file
I'm generating a SAVE file and comparing it to an existing file (this is a conversion project) and have discovered that in the OLD file each line is terminated with CRLF (carriage return, line feed), but the NEW file is terminated with only a CR.

Does anyone know how to force WF to generate the CRLF?


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
October 09, 2007, 04:49 PM
Prarie
You might try this in the Stylesheet

TYPE=REPORT,LINEBREAK='crlf',$


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Alan

what format do you use?

ON TABLE SAVE FORMAT ...

The used format gives different results.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

ON TABLE SAVE FILENAME 'E:\ibi\apps\hris\BENMAR01.txt'

-------------------------------------------------------------

I only need to do this to compare the two files and don't really care about the CRLF except it makes it difficult to identify the rows that are really different (not CRLF). It turns out the editor I'm using can convert the file to a DOS format and will change the CR to a CRLF for me.

Thanks for your help.


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
well I misread this question. Music


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I am having the same problem. I am creating an 'alpha' output file. How do I add the CRLF (carriage return)?
Hm, I wonder what your procedure(s) looks like. If I create hold files (binary and/or alpha) and edit the results with a hex-editor then I see no CR/LF's at all in the binary holds (which figures, since they are being created with fixed record length), but the alpha hold does contain both the cr and lf characters in my environment (Windows XP). The alpha holds contain the 0D 0A combination at the end of every record. This is valid when run in 717 as well as in 761.
Code I used:
 
APP HOLD SESSION
TABLE FILE CAR
SUM
     DEALER_COST
     RETAIL_COST
     SALES
BY COUNTRY NOPRINT
BY SEATS
ON TABLE SAVE AS FILE1
END

And then change SAVE into HOLD FORMAT ALPHA or HOLD FORMAT BINARY or SAVB.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
I'm doing a simple HOLD FORMAT ALPHA, and yes, I get the 0D 0A at the end of every row. My problem was when I tried to do a compare between the OLD (only OA) file and the NEW file (both 0D 0A) using UltraEdit, it would flag every row as different, which makes the compare useless. Now I'm using TextPad which can convert the file so that the compare works properly.


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
I said it backwards: the OLD file has 0D 0A at the end of every row; the NEW file (creaetd by WF) only has 0A at the end of every row.

I do still have a problem since I want the NEW file to be exactly like the OLD file...


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
When running this on Windows (wf5.3.3), I do see the 0D 0A, but when running on Linux(wf7.6.1) I only see the 0A.

One solution we have is to run the following command:
-UNIX unix2dos &filename

But we are looking for an internal webfocus solution. Any ideas?
c1,
At this point, no. I would prefer a WF solution, too, but I may have to look for something outside WF. Right now I'm waiting to test one of the dozens of export files to see if it causes any problems at the other end.

If it does, I gotta make it happen.

CTRAN might do the trick. Create an A1 field and translate it to ASCII '0D' and print it as the last character in each row. I test it out and let you know what I get.


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
Well, CTRAN almost works...the following translates a space to a ^ just fine but won't translate it to a CR (decimal 13).

-SET &ECHO=ALL;
DEFINE FILE EARNINGS_VW
LASTCHAR/A1 = CTRAN(1, ' ', 32, 94, LASTCHAR) ;
END
TABLE FILE EARNINGS_VW
PRINT EMPLID
LASTCHAR
WHERE RECORDLIMIT EQ 10
ON TABLE SAVE FILENAME 'E:\ibi\apps\hris\LASTCHAR.txt'
END
-EXIT


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL
Maybe HEXBYT will work in this setup?
 
-SET &ECHO=ALL;
DEFINE FILE EARNINGS_VW
LASTCHAR/A1 = HEXBYT(13, LASTCHAR) ;
END
TABLE FILE EARNINGS_VW
PRINT EMPLID
LASTCHAR
WHERE RECORDLIMIT EQ 10
ON TABLE SAVE FILENAME 'E:\ibi\apps\hris\LASTCHAR.txt'
END
-EXIT
 



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Nope, I got the same results -- a space instead of x'0D'...good try though.

Back to the drawing board.

Thanks.


WF 7.6.6, FOCUS 7.6.4, IBM MVS/TSO, Windows 2003 Server, DB2, MSSQL