Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Output Single Line Text File
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Output Single Line Text File
 Login/Join
 
Platinum Member
posted
I am trying to create a text file (TABT) with only one line of text: "ABCD"

I've tried:

TABLE FILE CAR
PRINT *

ON TABLE SUBHEAD 
"ABCD"

ON TABLE PCHOLD FORMAT TABT
END


But it gives me a password error.

Does anyone know how to create a text file where the output is just a single line of text?

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I figure out what I was looking for:

SET ASNAMES = ON

DEFINE FILE CAR
TRIGRNAME/A50= '';
END

TABLE FILE CAR
SUM
TRIGRNAME AS 'ABCD'

WHERE RECORDLIMIT EQ 1

ON TABLE PCHOLD FORMAT TABT
END


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Maybe I don't have this yet.

My solution prints the header line "ABCD", but then has a carriage return and a second row.

I need JUST the header line.

Any ideas?


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Use Dialogue Manager and -WRITE the file.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
The other question here is why do you need a single line tab delimited file ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6309 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
<JG>
posted
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
 
Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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
-*----------------------------------------------------------------------------

Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 226 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
-WRITE OUT_TRIG &TRIG_FILE


Isn't that what I said to do several posts ago?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
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.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6309 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thank you all for your help. I've gotten the solution that I needed!

-CWM


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
  
DEFINE FILE CAR
TRIGRNAME/A50= '';
END

TABLE FILE CAR
SUM
TRIGRNAME AS 'ABCD'

WHERE RECORDLIMIT EQ 0

ON TABLE PCHOLD FORMAT TABT
END


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Output Single Line Text File

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.