Focal Point
[SOLVED] problem with alpha text file wrapping data

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4381013103

October 02, 2008, 09:47 AM
Selena B
[SOLVED] problem with alpha text file wrapping data
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
Vista
October 02, 2008, 11:45 AM
FrankDutch
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.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 02, 2008, 11:45 AM
Francis Mariani
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


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
October 02, 2008, 12:11 PM
Selena B
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
Vista
October 02, 2008, 12:23 PM
FrankDutch
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.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 02, 2008, 02:03 PM
Selena B
Thanks for all of the input! I will try your suggestion Frank. I think that will work.


7.1.7
Vista
October 02, 2008, 05:33 PM
Darin Lee
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



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