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     [SOLVED] DFIX DELIMITER that eliminates columns with empty instances

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DFIX DELIMITER that eliminates columns with empty instances
 Login/Join
 
Gold member
posted
Hey,

I am using:
ON TABLE HOLD FORMAT DFIX DELIMITER . , which works perfectly fine.

The thing I need to further add to this is something that will eliminate columns with spaces. So the output I have is:

[Column1. .Column3] I need-> [Column1.Column3]

Thank you in advance

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



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report This Post
Expert
posted Hide Post
I don't think you can do that. It wouldn't make much sense because each row could potentially have a different number of columns, and the file would not be able to be read by the generated master.

APP HOLDMETA TESTFM
APP HOLDDATA TESTFM
-RUN

TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS H001DFIX FORMAT DFIX DELIMITER .
END
-RUN

TABLE FILE H001DFIX
PRINT *
END
-RUN


If you will be using this file in an external application and don't care about the number of columns, here is an example that might work for you. It uses the EMPLOYEE database which is a sample database supplied with WebFOCUS. It creates a HOLD file in DFIX format, including the blank columns. Then I create a temporary master that defines one column containing all the columns in the row.

I use the STRREP (Replacing Character Strings) function to remove the DFIX character for the blank columns. I have used # as the DFIX character because . will be confused with a decimal point.

SET HOLDLIST=PRINTONLY
APP HOLDMETA testfm
APP HOLDDATA testfm
-RUN

TABLE FILE EMPLOYEE
PRINT
EMP_ID
LAST_NAME
FIRST_NAME
BANK_NAME
BANK_ACCT
ED_HRS
SALARY

ON TABLE HOLD AS H001DFIX FORMAT DFIX DELIMITER #
END
-RUN

FILEDEF MASTER DISK h001dfix1.mas
-RUN

-WRITE MASTER FILENAME=H001DFIX1, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=H001DFIX1, $
-WRITE MASTER FIELDNAME=LINE1, FORMAT=A400, ACTUAL=A400, $

FILEDEF H001DFIX1 DISK testfm/h001dfix.ftm
-RUN

TABLE FILE H001DFIX1
PRINT
COMPUTE LINE2/A400 =
  STRREP (400, LINE1, 3, '# #', 1, '#', 400, 'A400');
-*STRREP (inlength, instring, searchlength, searchstring, replength, repstring, outlength, outstring)
END
-RUN


Before people start hurling abuse at you for not filling out your Signature, please visit your Profile and click on "View/Edit Complete Profile", which is where you can enter the version of WebFOCUS and other information in the "Signature".

Regards,

This message has been edited. Last edited by: Francis Mariani,


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
Gold member
posted Hide Post
I appreciate the notice and I have changed my signature!! Smiler

So, my next question is how would I correct the code below to get the
ON TABLE HOLD AS MATESTHLD FORMAT DFIX DELIMITER . (customer needs the format to include periods) to do what is proposed? Or is there another command that is like the COMT, reason being is the COMT does what I am looking for with the columns, but instead of ","....simply . ??

_*******

FILEDEF MATESTHLD DISK /usr/home/ftp/pub/matesthld.ftm

TABLE FILE FTPSCRIPTDATA
PRINT
NAME
IDNUM
STARTDATE
ENDDATE
ON TABLE SET STYLE *
ENDSTYLE
ON TABLE HOLD AS MATESTHLD FORMAT DFIX DELIMITER .
END

TABLE FILE MATESTHLD
PRINT *
END
unix echo "open host.server1.com" > /usr/home/ftp/pub/matest.txt
unix cat /usr/home/ftp/pub/pwd.txt >> /usr/home/ftp/pub/matest.txt
unix echo " " >> /usr/home/ftp/pub/matest.txt
unix echo "ascii" >> /usr/home/ftp/pub/matest.txt
unix echo "put matesthld.ftm 'matest.txt'" >> /usr/home/ftp/pub/matest.txt
unix echo "quit" >> /usr/home/ftp/pubmatest.txt
-EXIT

-*******

Also, another problem I am having is the Unix commands do not recognize the bolded text above, and ends ftp-ing at the put statement...fails and exits before completion.

Thanks!



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report This Post
Expert
posted Hide Post
I can answer the last question. You have to put all of your Unix commands in a script and then execute the script. In WF, everytime you say unix or !, it drops to the shell, executes the command, and them comes back to WF. Since ftp is interactive, you have to stay in the same session which is why you need to execute a script instead.


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, 2006Report This Post
Gold member
posted Hide Post
I am able to successfully ftp and I have done so before, I thank you for your suggestion and will note it...does anyone else have any other comments about that though?

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



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report This Post
Expert
posted Hide Post
Mayor, could it be that when you go into FTP, it changes your current directory to your users $HOME directory, therefore the file is not found ?


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: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Yup....I see that the file was created in my home directory....I do not understand why though? How can I fix that?

Thanks,



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report 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     [SOLVED] DFIX DELIMITER that eliminates columns with empty instances

Copyright © 1996-2020 Information Builders