Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] &LINES count after an append
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] &LINES count after an append
 Login/Join
 
Silver Member
posted
When using the &LINES function after an append it seems to give the number of lines that it added last and not a complete count of the file.

 FILEDEF CAR2 DISK CAR2
TABLE FILE CAR
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
WHERE COUNTRY EQ 'FRANCE';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR2 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

TABLE FILE CAR
PRINT
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR1 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
FILEDEF CAR2 DISK CAR2 (APPEND

TABLE FILE CAR1
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR2 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

-TYPE &LINES 


The above code returns a count of 4 (which is the count from England but is excluding the 1 from France which was already in the file.
If we re-read the file into a secondary hold file it gives us the correct count.


 FILEDEF CAR2 DISK CAR2
TABLE FILE CAR
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
WHERE COUNTRY EQ 'FRANCE';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR2 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

TABLE FILE CAR
PRINT
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR1 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
FILEDEF CAR2 DISK CAR2 (APPEND

TABLE FILE CAR1
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR2 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

TABLE FILE CAR2
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR3 FORMAT ALPHA
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

-TYPE &LINES 


Is this correct or am I mis-understanding how the &LINES is supposed to function?

This message has been edited. Last edited by: FP Mod Chuck,


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 2008Reply With QuoteReport This Post
Virtuoso
posted Hide Post
&LINES will be the number of lines of output accumulated in the last command, if it is a command (such as TABLE or GRAPH) that does such. &LINES is (I believe) computed before the command disposes of the lines (via HOLD, SAVE, or as a formatted report), so the "(APPEND" in your FILEDEF does not influence the value of &LINES for that step.

In your case that last command is
TABLE FILE CAR2
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
...
ON TABLE HOLD AS CAR3 FORMAT ALPHA
...
END

which reads the entire file (original rows plus appended rows) that is target of the HOLD in the previous step.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thanks for the quick reply.
That was what I sort-of figured based on how it was working but just wanted clarification


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] &LINES count after an append

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