Focal Point
[Solved]HOLD THE RESULT OF MULTIPLE MORE COMMAND

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/590103821

May 27, 2009, 11:33 AM
alu
[Solved]HOLD THE RESULT OF MULTIPLE MORE COMMAND
Hi all,
I have a few hold file with same field name and format, for example HOLD1, HOLD2, HOLD3 till HOLD&CNT.
I need to concatendate all these file together to get a new hold file NEWHOLD. The following code work fine, display the concatenated result. But I have trouble to hold the result somewhere. I have tried different place to put the ON TABLE HOLD AS NEWHOLD command, ex LOCATION1, LOCATION2. But I got error message with both location.
for location1, error message is :
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: EXEC

for location2, error message is :
(FOC953) INVALID STRUCTURE IN SUBREQUEST: ON
BYPASSING TO END OF COMMAND
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: EXEC

From the webfocus document, my understanding is that I should put the hold commmand at location1. I did a search, some example put at location1, some put at location2.

Could someone please tell me how can I hold the result?

Thanks a lot.



[CODE]
-SET &LOOP_CNT = &CNT -1;
TABLE FILE HOLD&CNT
PRINT COL1 COL2 COL3
-* LOCATION1
-REPEAT LOOP1END &LOOP_CNT TIMES
-SET &CNT = &CNT-1;
MORE
FILE HOLD&CNT
-* LOCATION2
-LOOPEND
END
RUN
[CODE]

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


WF Server: 5.3.2, 7.1.6 on Unix, ReportCaster, Self-Service, MRE, Java
Output: HTML,PDF,Excel
WF Client: Tomcat, Servlet
May 27, 2009, 12:15 PM
GinnyJakes
I'm not quite sure what you are saying but I do see a syntax error in your posted code. Your -REPEAT says to go to tab LOOP1END but your tag is actually called -LOOPEND. You need to fix one or the other.

To hold the result in a permanent place, you can put an APP HOLD dirname at the beginning of your code where dirname is a real directory or one that you have app mapped.


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
May 27, 2009, 12:58 PM
BlueZone
As Ginny says, I am not exactly sure if this is the entire snippet of code you are dealing with.

I would review how the loop is being built in the first place by putting these 2 lines just above the TABLE FILE
SET XRETRIEVAL=OFF
-SET &ECHO=ALL;

Any syntactical errors will get kicked out right there. If this check passes and you still get an error on execution, try using the .EVAL, correct the labelname, add a semi-colon at the end of the -REPEAT and a dashRUN.

 
-SET &LOOP_CNT = &CNT -1;
TABLE FILE HOLD&CNT
PRINT COL1 COL2 COL3
ON TABLE HOLD AS HOLDNEW
-REPEAT LOOPEND &LOOP_CNT TIMES;
-SET &CNT = &CNT-1;
MORE
FILE HOLD&CNT.EVAL
-LOOPEND
END
-RUN
 


Best regards,
Sandeep Mamidenna

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


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
May 27, 2009, 02:05 PM
alu
Thank you Ginny and BlueZone for your "sharp" eyes and kindness. I successfully hold the result by adding a dash to the RUN. The labelname mistake is made when I post the code. I'll remember the tip of using the SET XRETRIEVAL=OFF and SET &ECHO=ALL to catch syntactical errors.

Regards


WF Server: 5.3.2, 7.1.6 on Unix, ReportCaster, Self-Service, MRE, Java
Output: HTML,PDF,Excel
WF Client: Tomcat, Servlet