Focal Point
[CLOSED] saved file size increrased.

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

February 25, 2011, 08:34 AM
Raoja
[CLOSED] saved file size increrased.
Hi ,

I am working on webfocus 7.6.11 version. I am new to webfocus .

Probelm description:

I am reading one xml file using FILEDEF and save in to another XML . I am able to save but output file size increased , because of lot of spacess are stored in output file .
if input file size is 90 KB , the output file size 2,633 KB.
Please see below my code

-SET &ECHO =ALL;
-SET &LOGDIR = E:\;
-SET &FILE == 'WORKFILE.XML';
-SET &WORKDIR =&LOGDIR;
-SET &FILENAME=&FILE;
-SET &FDFILE=&WORKDIR | &FILE;
-SET &OUTRES =&WORKDIR | 'YYRESULT.XML;
-SET &OUTRES='ON TABLE SAVE FILENAME ' | &LOGDIR | 'YYRESULT.XML';
FILEDEF GPRS DISK &FDFILE
TABLE FILE GPRS
PRINT
FIELD1
&OUTRES
END
-RUN
Please help me on this problem.

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


7.6.11, Windows
Excel,html,pdf,xml
February 27, 2011, 03:47 PM
Waz
This is default functionality for WebFOCUS.

Assuming that your master file GPRS has a single field FIELD1, that is used to read each line of the XMLS file, then the output size will be No of lines in * FIELD1 usage size.

There are some ways to write out a trimmed line.

My current favourite one is PUTDDREC:

Assuming FIELD1 Usage is A100.

SET &ECHO =ALL;
-SET &LOGDIR = E:\;
-SET &FILE == 'WORKFILE.XML'; 
-SET &WORKDIR =&LOGDIR;
-SET &FILENAME=&FILE;
-SET &FDFILE=&WORKDIR | &FILE;
-SET &OUTRES =&WORKDIR | 'YYRESULT.XML;
-SET &OUTRES='ON TABLE SAVE FILENAME ' | &LOGDIR | 'YYRESULT.XML';
FILEDEF GPRS DISK &FDFILE
FILEDEF XMLOUT DISK &LOGDIR..YYRESULT.XML
TABLE FILE GPRS 
PRINT COMPUTE RETCODE/I3 = PUTDDREC('XMLOUT',6,FIELD1,ARGLEN(100,FIELD1,'I3),RETCODE) ;
ON TABLE HOLD AS OUTRES
END 
-RUN


The function PUTDDREC writes a line to a pre-allocated file (FILEDEF), and the ARGLEN specifies the number of characters to output.


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!