IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [SOLVED] problem with alpha text file wrapping data
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
I have a user that is doing an app fi to create a text file formatted as alpha. When you look at the text file, some of the lines are wrapped to a second line thus causing issues when trying to create a report or graph off the the text file. Is there a way to create the text file and prevent the fields that have a lot of text from wrapping to the next line? Here is part of the code:

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SIDATA4GRAPHS
END

APP FI SIDATA4GRAPHS1 DISK d:\ibi\apps\sball\sidata4graphs.txt
APP HOLDMETA VISDIS

TABLE FILE SIDATA4GRAPHS
PRINT *
BY BUSINESS_UNIT NOPRINT
WHERE CREATE_DATE NE MISSING;
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS SIDATA4GRAPHS1 FORMAT ALPHA
END

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


7.1.7
xp
 
Posts: 24 | Registered: July 05, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Selena

If you want to use the output from the database to be used in a report or graph it is maybe not a good idea to save it as a text file.
I would just hold it as an internal format file.




Frank

prod: WF 7.6.5 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.5 on the same platform and databases,IE7

 
Posts: 1640 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
The rows of data should not wrap. Are you sure it's not the editor you're using to view the hold file that's causing the data to wrap?

It is possible that carriage-return/line-feed characters embedded in the data could cause it to wrap. If you have a column that is text entered by a user, it may have embedded carriage-return/line-feed characters.


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
The database team suggested using the following in the sql code:
,replace(BACKGROUND_INFO,chr(13),NULL) BACKGROUND_INFO
,replace(NEXT_ACTION,chr(13),NULL) NEXT_ACTION
,replace(RISK_ASMNT_EXTN_APPROVAL,chr(13),NULL) RISK_ASMNT_EXTN_APPROVAL

The user is creating a text file because it is easier on the system to get the data one time and report off of it rather than hitting the database every single time (this is due to the complex table structure on the db side to get all of the fields that are needed).
I don't think it's the editor. The user stated that when she does a count on some of the fields, the count is incorrect.


7.1.7
xp
 
Posts: 24 | Registered: July 05, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Selena

In this case I would do this:

run this code say once a day (you can schedule it with ETL or RC)

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD
END
-RUN
APP HOLD BASEAPP
DEFINE FILE HOLD
RUNDATE/YYMD=&YYMD;
END
TABLE FILE HOLD
PRINT *
ON TABLE HOLD AS SIDA4GRP FORMAT FOCUS
END


Now the user has the SID4GRP data available in a FOCUS database, that will be renewed every day.
I added the RUNDATE field so you can see it is that special day. (Maybe if you also need runtime ad &TOD).
Now The user can build the needed reports based on that focus database.




Frank

prod: WF 7.6.5 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.5 on the same platform and databases,IE7

 
Posts: 1640 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Thanks for all of the input! I will try your suggestion Frank. I think that will work.


7.1.7
xp
 
Posts: 24 | Registered: July 05, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Another problem I have occasionally seen is that the text file is subsequently read with a Master file that does not properly described the text file layout. For example if you have a record that is 10 characters long and the field format that reads it is A9, then WF just supposes that everything after the 9th character must be the next record, so although it appears as if it is wrapping to the next line, it is actually showing it as the next record. Don't know if that might be the issue but I've seen similar "symptoms" like this before.
Frank's suggestion would also solve the problem because the Master file that subsequently reads it is automatically created to accurately describe the data layout.


Regards,

Darin



WF Server: 7.1.6 on Z/OS and Linux, ReportCaster, Self-Service, MRE, Java
Data: DB2, DB2/UDB, Adabas, SQL Server Output: HTML,PDF,Excel2K
WF Client: Linux w/WebSphere, Servlet, CGI
 
Posts: 1306 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [SOLVED] problem with alpha text file wrapping data

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