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     Print every millionth row

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Print every millionth row
 Login/Join
 
<Pietro De Santis>
posted
Is there an easy way to print every millionth row in a text file?

I know I could create a Counter as a DEFINEed field and select particular rows based on the counter (e.g. WHERE COUNTER EQ 1000000 or 2000000...). Is there a different way?

As well, do you think WebFOCUS can read a text file that's 32 million rows long, 170 characters in each row?

Thanks,

Pietro.
 
Report This Post
<Pietro De Santis>
posted
Here's what I've programmed. Just wondered if there's a better way.

-SET &COUNT_INT = 10000;

FILEDEF TESTTEXT DISK C:\TEMP\testtext.txt
-RUN

DEFINE FILE TESTTEXT
COUNTER/D12 = COUNTER + 1;
REMAINDER/D12 = IMOD(COUNTER, &COUNT_INT, REMAINDER);
END

TABLE FILE TESTTEXT
PRINT COUNTER DATACOLUMN
WHERE REMAINDER EQ 0
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF, FONT='VERDANA', SIZE=8, $
ENDSTYLE
END
 
Report This Post
Virtuoso
posted Hide Post
That's the approach I'd take. But I'd give the two defined variables I formats; and perhaps use TABLEF.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Pietro De Santis:
[qb] ... do you think WebFOCUS can read a text file that's 32 million rows long, 170 characters in each row?[/qb]
Table reads one rec at a time; for 32,000,000 inut records, the internal matrix will grow to 32 rows -- not much of a problem. Smiler
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Pietro, i'ld do it the harder way
-SET &KOUNTER = 0;
-TOPLOOP
-READ MYFILE NOCLOSE &STUFF.A170
-IF &IORETURN NE 0 GOTO EOJ;
-SET &KOUNTER = &KOUNTER + 1;
- do your MOD function here to eval the Kounter;
-IF &MYTESTVAL NE 1000000 GOTO ENDLOOP;
-WRITE &STUFF
-ENDLOOP
-GOTO TOPLOOP;
...feel free to laugh.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     Print every millionth row

Copyright © 1996-2020 Information Builders