Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Removing Leading/Trailing Spaces

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Removing Leading/Trailing Spaces
 Login/Join
 
Gold member
posted
Here are some sample source fields and their format

FIELD1 - A15
FIELD2 - P12.4
FIELD3 - HMDYYS
FIELD4 - A35

I need to output these fields into a pipe delimited ASCII file so the output looks as follows. It is important not to have any leading or trailing spaces. I am struggling to eliminate the trailing spaces. Any suggestions?

FIELD1|FIELD2|FIELD3|FIELD4

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Guru
posted Hide Post
 DEFINE FILE CAR
FIELD1/A15 = 'Test Alpha';
FIELD2/P12.4 = 1234.5678;
FIELD3/HMDYYS ='2015/01/23 04:34:00.000000';
FIELD4/A35 = 'Test Alpha';
END
TABLE FILE CAR
PRINT FIELD1 FIELD2 FIELD3 FIELD4
BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT DFIX DELIMITER |
END 


Any problem with this?


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
Good One


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Rifaz - Thanks much for the tip! There is a slight issue though - this doesn't seem to work with the ON TABLE SAVE command if I do
ON TABLE SAVE FILENAME '\\srvstorage\FILENAME.DAT' FORMAT DFIX DELIMITER |

Is there another way to save this file. Its important that the file name stays in upper case.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Guru
posted Hide Post
quote:
ON TABLE SAVE FILENAME '\\srvstorage\FILENAME.DAT' FORMAT DFIX DELIMITER |


I never used FILENAME keyword. So, the problem now is to save the filename in uppercase. Hope this helps.

-SET &_FILENAME=UPCASE(17, 'DELIMITERFILE.DAT', 'A17');
DEFINE FILE CAR
FIELD1/A15 = 'Test Alpha';
FIELD2/P12.4 = 1234.5678;
FIELD3/HMDYYS ='2015/01/23 04:34:00.000000';
FIELD4/A35 = 'Test Alpha';
END
FILEDEF UPPER DISK baseapp/&_FILENAME
-RUN
TABLE FILE CAR
PRINT FIELD1 FIELD2 FIELD3 FIELD4
BY COUNTRY NOPRINT
ON TABLE SAVE AS UPPER FORMAT DFIX DELIMITER |
END 


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Gold member
posted Hide Post
Hi Rifaz,
Thanks so much for further input. However, it seems that DFIX only works with PCHOLD or HOLD format. So now I am doing APP HOLD and then TABLE HOLD - however, it always saves the file in lower case when I want upper case (I am trying to use -WINNT command to change filename to uppercase). If you have any smarter way to create an upper case file, please let me know. Also, if you could provide input for this case - would greatly appreciate it. Much thanks!
http://forums.informationbuild...1057331/m/1117032776


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Guru
posted Hide Post
Please post your complete code. Sorry, have no idea on other post, however, just a thought & hope you'd have SET HOLDLIST=PRINTONLY in your fex.


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Expert
posted Hide Post
FILEDEF HFILE1 DISK BASEAPP/HFILE.TXT
-RUN

DEFINE FILE CAR
FIELD1/A15 = 'Test Alpha';
FIELD2/P12.4 = 1234.5678;
FIELD3/HMDYYS ='2015/01/23 04:34:00.000000';
FIELD4/A35 = 'Test Alpha';
END
TABLE FILE CAR
PRINT FIELD1 FIELD2 FIELD3 FIELD4
BY COUNTRY NOPRINT
ON TABLE HOLD AS HFILE1 FORMAT DFIX DELIMITER |
END
 


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Removing Leading/Trailing Spaces

Copyright © 1996-2020 Information Builders