The other question here is why do you need a single line tab delimited file ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 24, 2008, 02:42 AM
<JG>
1st TABT will always generate at least 2 rows, A header row and a data row.
Use FORMAT TAB not TABT
2nd -WRITE Will not write tabs it replaces them with a space (the parser strips tabs from code)
3rd DEFINE and COMPUTE will not create a field containing tabs for the same reason as in 2 above.
use tab and create each component seperately
TABLE FILE CAR SUM COMPUTE A/A50 WITH CAR= 'A'; COMPUTE B/A50 WITH CAR= 'B'; COMPUTE C/A50 WITH CAR= 'C'; COMPUTE D/A50 WITH CAR= 'D'; BY CAR NOPRINT WHERE RECORDLIMIT EQ 1 ON TABLE SET HOLDLIST PRINTONLY ON TABLE HOLD FORMAT TAB END
October 24, 2008, 08:49 AM
ColdWhiteMilk
One of my projects requires me to send two files to my customer, the data and a trigger.
The first file, the data is the detailed results of the query.
The second file, the trigger, is a single line text file with the name of the first file as that single line.
The customer's automation looks for the existence of that trigger file to know when/what to process.
Production - 7.6.4 Sandbox - 7.6.4
October 24, 2008, 10:19 AM
jfr99
Here's an example using the CAR file that creates an extract file and a trigger file.
-*--------------------------------------------------------------------------- -SET &DATA_FILE = 'tst_car_extract.txt'; -SET &TRIG_FILE = 'tst_car_trigger.txt'; -* -TYPE DATA_FILE ---------- &DATA_FILE -TYPE TRIG_FILE ---------- &TRIG_FILE -* FILEDEF OUT_DATA DISK &DATA_FILE FILEDEF OUT_TRIG DISK &TRIG_FILE -RUN -TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -TYPE +++ CREATE EXTRACT FILE +++ -TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TABLE FILE CAR PRINT CAR BY COUNTRY ON TABLE HOLD AS OUT_DATA FORMAT ALPHA END -RUN -TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -TYPE +++ CREATE TRIGGER FILE +++ -TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -WRITE OUT_TRIG &TRIG_FILE -RUN -*----------------------------------------------------------------------------
If you want to table and hold a single line without the CR, then HOLD it.
If you have a single column, its irrelevant what the format is.
If you have multiple columns, try this below.
DEFINE FILE CAR
Tab/A1 = HEXBYT(9,'A1') ;
END
TABLE FILE CAR
PRINT COUNTRY Tab CAR
ON TABLE HOLD AS NOCR
WHERE RECORDLIMIT EQ 1
END
A HOLD pads the columns out to multiples of 4 bytes, if this is unacceptible, then use ON TABLE HOLD FORMAT INTERNAL.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 30, 2008, 03:53 PM
ColdWhiteMilk
Thank you all for your help. I've gotten the solution that I needed!
-CWM
Production - 7.6.4 Sandbox - 7.6.4
October 30, 2008, 03:59 PM
Darin Lee
Could you please let us know what your solution was so that it may be of benefit to others in the future? Thanks.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
October 30, 2008, 04:52 PM
ColdWhiteMilk
DEFINE FILE CAR
TRIGRNAME/A50= '';
END
TABLE FILE CAR
SUM
TRIGRNAME AS 'ABCD'
WHERE RECORDLIMIT EQ 0
ON TABLE PCHOLD FORMAT TABT
END