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     [SOLVED] Print numbers from 1 till the number entered by the user

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Print numbers from 1 till the number entered by the user
 Login/Join
 
Guru
posted
I want to print all numbers from 1 till the number I have entered through HTML.
I don't want to use SQL at all. No database. It should be pure WebFOCUS

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


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Silver Member
posted Hide Post
Dialog Manager? I'd start with the code below. It will prompt for &END

-SET &START = 1;
-LOOP001
-TYPE &START
-SET &START = &START + 1;
-IF &START LE &END GOTO LOOP001;


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
 
Posts: 34 | Registered: May 09, 2008Report This Post
Virtuoso
posted Hide Post
Well, Brian gave you the answer, but it's just a list on the screen - no records, no tables, etc. His solution gives you EXACTLY what you asked for, but there's not much you can do with it after that.

Thought I might mention that WebFOCUS IS a database reporting tool. If you're not reading any data, WF is an expensive tool to accomplish your task. In fact, you could simply accomplish your task with Javascript and wouldn't even need the additional communication to a WF server. Is there a specific reason you need WF to do this?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Guru
posted Hide Post
Hi Darin,
This is question i was about to ask.I want the data in tabular form i.e, it should retrieve the value from a file and print it.The code given above just use TYPE command to display the result.
Is there any way to keep the data in some hold file and then display it from there?Similarly,I want to display the series of fibonacci series and prime numbers.
Please suggest.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Expert
posted Hide Post
In the DM code above, instead of -TYPEing the number, -WRITE it into a file instead. Then write a master file description to describe it, filedef them together, and then you can use TABLE to do a report.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
WF won't produce anything in tabular form unless it is reading it from some sort of database. If you want to "keep the data in some hold file and then display it from there," you're using a database - which you said you did not want. So you'll have to decide whether that is OK. If it is, then you'll get there quicker (and less IO) by reading the first n records of some table and printing out the line number.
TABLE FILE CAR
LIST MODEL NOPRINT
END

This still could be accomplished with Javascript or even Excel for that matter. Is there a reason for WF to be in the mix?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Shankar, you need the Macgyver techique, the traditional one.

Try this, it has a maximum of 4096.
-DEFAULT &FSEQ_CNT = 100 ;

-* Write out a master to read the C_FSEQ
EX -LINES 9 EDAPUT MASTER,C_FSEQ,CV,FILE
  FILE=C_FSEQ, SUFFIX=FIX
SEGNAME=SEG1
FIELD=Blank , , A1, A1, $
SEGNAME=SEG2, PARENT=SEG1, OCCURS=&FSEQ_CNT
FIELD=WHATEVER, , A1, A1, $
FIELD=Counter, ORDER, I4,  I4, $
DEFINE BLANK/A1   WITH Blank   = ' ' ;
DEFINE COUNTER/I4 WITH Counter = LAST COUNTER + 1 ;

-RUN

FILEDEF C_FSEQ DISK c_fseq.mas (LRECL &FSEQ_CNT

-RUN
TABLE   FILE C_FSEQ
 PRINT  COUNTER
 BY     BLANK

 WHERE  RECORDLIMIT EQ &FSEQ_CNT

-* ON     TABLE HOLD AS FSEQ FORMAT FOCUS INDEX BLANK

END

-RUN

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


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
<JG>
posted
You not not need a database or anyother source to produce tabular output in WebFOCUS

In pure DM/HTML
 
-SET &END =133;
-SET &CNTR=0;
-HTMLFORM BEGIN
<TABLE>
<TR><TD>Number</TD><TD>Fibonacci</TD><TD>Prime</TD</TR>
-SET &START = 0;
-SET &LASTSTART = 0;
-REPEAT ENDREPEAT &END TIMES
-SET &START = &START + 1;
-SET &FIB=&LASTSTART+&START;
-SET &PRIME= IF &START IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 
-                          61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 
-                          131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 
-                          197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271)
-            THEN '*' ELSE ' ';
<TR><TD>!IBI.AMP.START;</TD><TD>!IBI.AMP.FIB;</TD><TD>!IBI.AMP.PRIME;</TD></TR>
-SET &LASTSTART= &START;
-ENDREPEAT
</TABLE>
-HTMLFORM END
 


Obviously if you are allowing people to enter larger numbers then you will need to extend
the prime test or find an algorithm to calculate them; I’m not going to do that.
 
Report This Post
Guru
posted Hide Post
I got my answer.Thanks to all.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report 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     [SOLVED] Print numbers from 1 till the number entered by the user

Copyright © 1996-2020 Information Builders