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]Question about -REPEAT command

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Question about -REPEAT command
 Login/Join
 
Guru
posted
I'm trying to print data from a file to an output file that can contain multiple occurences of data for a student, concerning semesters the student has attended a college. In other words, a student might have attended in Fall semester 2002, then spring semester 2004, then summer semester 2005 and so on. Here is what I'm using to try:

-*
TABLE FILE A057SSN
-*
-REPEAT LOOPDONE AA191 TIMES
-*
PRINT
ACKEY
STUDYID
STU_ID
TERM_NAME
RT14A AS RT14A
RT005
ACAD_STATUS AS ACAD_STATUS
AA640 AS AA640
AA650 AS AA650
AA671 AS AA671
BY ACKEY
BY STU_ID
-LOOPDONE
ON TABLE HOLD AS E002A FORMAT FOCUS INDEX ACKEY
END
-RUN
-*


However, it is not working. On the REPEAT line, I have -REPEAT LOOPDONE AA191 TIMES, where field AA191 is a record occurrence counter that indicates how many times this information repeats for a student. The error message I receive is:


0 ERROR AT OR NEAR LINE 113 IN PROCEDURE ED002 FOCEXEC
0(FOC303) CONTROL LINE NOT RECOGNIZED IN FOCEXEC: -REPEAT LOOPDONE AA191
TIMES


Am I using a correct way of trying to repeat my data? If someone has a suggestion I would be happy to receive it. The manual wasn't exactly clear. Thanks in advance!

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Guru
posted Hide Post
You need to read the value of AA191 into an amper variable and then use that amper variable in your loop.
  
TABLE FILE TBL_NAME
SUM
     LST.AA191
ON TABLE SAVE AS HOLD1
END
-RUN

-READ HOLD1 &AA191.I4.
-RUN

-REPEAT LOOPDONE &AA191 TIMES 

Hope this helps. I am still a young padawan. Smiler


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Guru
posted Hide Post
Thanks for replying, Might Max,

Sounds plausible to me. I'll give it a try tomorrow.

I appreciate your suggestion.


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Expert
posted Hide Post
To add to the solution given by our young apprentice Wink

The reason is (as has been said many times before) that dialogue manager is parsed before the table request in this example. Therefore the request has not been executed and therefore no data values are available. Therefore a pre-extract of the value you want, and it's placement into a variable, is the way to go.

Note the use of -RUN after the table request to force execution of the stack so that the file is created before the dialogue manager -READ statement.

May the force etc. etc.

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
Master
posted Hide Post
In looking at your code I think your output is not going to be what you want. Are you wanting one record per student? Or one record per term?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Many thanks for the follow-on comments and explanations.

Pat, I am looking at, for each student, one record per term. In other words, having something like this:

Student001 Term1 info
Student001 Term2 info
Student001 Term3 info
Student002 Term1 info
Student003 Term2 info
Stuednt003 Term4 info

and so forth. I know this isn't the "prettiest" or most efficient listing out of data, but it's a requirement from the Dept. of Education, and that's what the data is the way it is.

Thanks again!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Forget about -REPEAT. You don't need to generate multiple PRINT verbs. (In fact, you cannot have multiple PRINT verbs in a TABLE request.)

Use something like this:
TABLE FILE XXX

SUM 
  (attributes of the student)
  BY student_key

PRINT 
  (attributes of the semester course)
  BY student_key
  BY semester_course_key(s)

ON TABLE HOLD [FORMAT FOCUS]...

The BY phrases provide for storing multiple rows per student.

If you use "FORMAT FOCUS", the result will be a two-segment, parent-child structure -- with the columns from the SUM part stored in the parent segment, and the additional columns from the PRINT part stored in the child segment -- reflecting the one-to-many relationship of student to course registration.

If you omit Format Focus, the internal processing still uses that structure for accumulating the data, but the stored result will be flattened, with the student' data replicated in each of the student's Course rows. But it will still have one row per student per course.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Master
posted Hide Post
Webmeister,

Jack's response hit the crux of my question, if you are wanting one record per student per term you don't need a -REPEAT. If you wanted one record per student containing the terms, the -REPEAT is in the wrong place. As Jack pointed out, you can not have multiple PRINT statements in a TABLE command. You can also do this as a single segment with:

TABLE FILE A057SSN

PRINT
STUDYID
STU_ID
TERM_NAME
RT14A AS RT14A
RT005
ACAD_STATUS AS ACAD_STATUS
AA640 AS AA640
AA650 AS AA650
AA671 AS AA671
BY ACKEY
BY STU_ID NOPRINT

ON TABLE HOLD AS E002A FORMAT FOCUS
END

But I have to wonder what your original input format is and what either buys you.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Jack and Pat,

Thanks for replying and helping out a "forest for the trees" issue. As far as what any of it bought me, not much...... this was a request from the Dept. of Ed., and their specifics were (and continue to be) tacky. One record per is about as close to normalization as nothing, but that's our wonderful government folk. I think the request came from somewhere in the 60's, when one record per was the norm.

In any case, thanks for thaking the time and effor to reply and to offer help; I appreciate it.


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report 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]Question about -REPEAT command

Copyright © 1996-2020 Information Builders