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.
Had exactly the same a while back. What I found was that MAINTAIN can read the records without the $ on the end, and with varying length. So a very simple maintain, can read in all these records, as a large alpha, plant a ,$ on the end a write the whole lot back.
The code is on a machine which has currently gone AWOL, so I would ahve to search through back-ups, but could get to it if you are interested.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Here are some datalines as you see, they put commas in it, but made it to a fixed format. the first two lines could give me some extra problems, as you see here the 'H' in the field and on the second line there is a stockprice that has a picture of D9.2 in stead of D9.4
I will be pleased to see how I (or you) can solf this.
FILEDEF IN_REC DISK C:\IN_REC.DAT (LRECL 1000
FILEDEF OUT_REC DISK C:\OUT_REC.DAT (LRECL 1000
MAINTAIN FILE IN_REC
DECLARE NEWLINE/A0;
FOR ALL NEXT IN_REC.ONE.LINE_RECORD INTO LINESTACK;
REPEAT LINESTACK.FOCCOUNT; CNTR/I4=1;
NEWLINE = LINESTACK(CNTR).LINE_RECORD ||',$';
TYPE ON OUT_REC "<NEWLINE";
ENDREPEAT CNTR=CNTR+1;
END
Just note the use of the 1000 field length in master and LRECL, this can be reduced but keep all in line.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Since the file looks like it has fixed width columns, I would create a Master with one column and use DEFINE to separate the text into individual columns. You could have the DEFINEs in the Master.
SUBSTR into an alpha field then convert from alpah to numeric where necessary.
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
Since it's just a flat file with fixed format, why not just create the Master that can read it directly. For example, this seems to read the sample data just fine:
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, 2007
We don't have the maintain functionality and to buy that just for one file is a bit too far.
Darin
What you suggest could work, but my problem is the lack of the ending ",$" in the file. My master almost works perfect when and if I add the dollar sign in the file.
Leave the data in the file as it is, would be the best, since it than can be replaced during the day at any time without let me do anything.
I think I will try to convince FT to add the "$" ...
Frank
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
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
This is format FIX so it does not require the ,$ like format COM does.
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, 2007