Focal Point
[SOLVED] read file variable

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

January 30, 2009, 05:17 AM
roby
[SOLVED] read file variable
Hy!
I have in input a variable file.
My program doesn't read all row.
In thh file there are 300 records but my program reads only 150.

File's definition
FVATE DD DSN=WA.WETLTEMR.LD999.TEVALORI.OK,DISP=NEW,CATLG),SPACE=(CYL,(2,5),RLSE),RECFM=VB,LRECL=500,BLKSIZE=5000

Master file

FILE=FVATE,SUFFIX=FIX
SEGNAME=ROOT
FIELD=APPO , ,USAGE=A2 ,ACTUAL=A2 , $
FIELD=SC_TITOLO , ,USAGE=I9L ,ACTUAL=A9 , $
FIELD=SC_SUFFTIT , ,USAGE=I6L ,ACTUAL=A6 , $
FIELD=SC_DIVISA , ,USAGE=I6L ,ACTUAL=A6 , $
FIELD=SC_CAUSALE , ,USAGE=I9L ,ACTUAL=A9 , $
FIELD=RESTO , ,USAGE=A468 ,ACTUAL=A468 , $

This message has been edited. Last edited by: Kerry,
January 30, 2009, 06:25 AM
<JG>
You do not say what platform or version of focus/webfocus

issue a filedef with a recfm and lrecl

(LRECL 500 RECFM F
January 30, 2009, 09:15 AM
Francis Mariani
Check that the number of characters define in the Master corresponds to the real record length of the file. Make sure that the field RESTO is not too long.


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
January 30, 2009, 09:34 AM
j.gross
Your ACTUALs add up to 500 -- I believe the sum should be 496, since the first 4 bytes of the record are a record-length prefix which counts in the LRECL but is not part of the logical layout. When the sum of ACTUALs in the MFD exceeds the correct value, each Focus read will pull data from the following record as well, which would account for getting EOF after issuing reads numbering half the number of records. So reduce the ACTUAL of the filler field (resto) by 4, in line with Francis' advice.
January 30, 2009, 10:23 AM
roby
thank you!!! Smiler