Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     -READ how to determine how many lines or records are in a file?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
-READ how to determine how many lines or records are in a file?
 Login/Join
 
Master
posted
Is there a command one can use to determine how many lines or records are in a file along with issuing
a -READ to read the data?

Roll Eyes


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Gold member
posted Hide Post
Not sure if you mean:

-LOOP
-READ fn &VAR.xx., . . .
-SET &RECCOUNT = &RECCOUNT + 1;
-IF &IORETURN NE 0 GOTO END_LOOP ;
-GOTO LOOP ;

-END_LOOP


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
 
Posts: 77 | Location: Baltimore | Registered: May 31, 2006Report This Post
Expert
posted Hide Post
Or this perhaps:

-SET &FILE1_COUNT = 0;

-READ FILE1 NOCLOSE &COUNTRY.A10.

-REPEAT END_LOOP1 WHILE &IORETURN EQ 0;

-SET &FILE1_COUNT = &FILE1_COUNT + 1;

-TYPE COUNTRY: &COUNTRY

TABLE FILE CAR
PRINT MODEL
WHERE COUNTRY EQ '&COUNTRY'
ON TABLE HOLD AS HOLD02 FORMAT ALPHA
END
-RUN

-READ FILE1 NOCLOSE &COUNTRY.A10.

-END_LOOP1


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Jim,

I think you meant this:

-SET &RECCOUNT = 1;
-LOOP
-*
-READ TSPF &SCHDTE.A8. &EVTDT.A8. &EVTTM.A8. &TRNTYP.A1.
-*
-TYPE REC#: &RECCOUNT &SCHDTE &EVTDT &EVTTM &TRNTYP
-*
-IF &IORETURN NE 0 GOTO END_LOOP;
-SET &RECCOUNT = &RECCOUNT + 1;
-GOTO LOOP;

-END_LOOP
-TYPE
-TYPE RECORD TOTAL = &RECCOUNT

-EXIT

THANKS! Cool


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Gold member
posted Hide Post
Yes, you're right, I missed that (in a hurry over here). Thanks for updating that! Smiler


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
 
Posts: 77 | Location: Baltimore | Registered: May 31, 2006Report This Post
Expert
posted Hide Post
Tom,

If the file is relatively small then there can be a valid time when you might want to do this, such as if you are actually going to do something with the data that you are reading in (e.g. assigning variable values) ...

but, if you have an MFD for it, then why not just issue a table request against it and then use &LINES?

If you haven't an MFD, then just create one on the fly and filedef your source to it, finally issue a table request and then use &LINES.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
If you have to go the route of issuing -READS then I would suggest keeping -GOTOs far and few between.

If you use a structured approach then you would read the file and then perform a loop while a read is successful - termed "read ahead".

-SET &RECCOUNT = 0;
-*
-READ TSPF &SCHDTE.A8. &EVTDT.A8. &EVTTM.A8. &TRNTYP.A1.
-*
-REPEAT END_LOOP WHILE &IORETURN EQ 0;
-*
-SET &RECCOUNT = &RECCOUNT + 1;
-TYPE REC#: &RECCOUNT &SCHDTE &EVTDT &EVTTM &TRNTYP
-*
-READ TSPF &SCHDTE.A8. &EVTDT.A8. &EVTTM.A8. &TRNTYP.A1.
-*
-END_LOOP
-TYPE
-TYPE RECORD TOTAL = &RECCOUNT

-EXIT


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     -READ how to determine how many lines or records are in a file?

Copyright © 1996-2020 Information Builders