Focal Point
Create Hold file from stack

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

August 31, 2006, 05:19 AM
<priya>
Create Hold file from stack
Hi

As I am new to webFOCUS ,I just want to know is it possible to generate one hold file with the help of stack file?Plese help me in solving this also.
August 31, 2006, 04:47 PM
Francis Mariani
What do you mean "with the help of stack file"?


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
September 04, 2006, 02:04 AM
kalyanswarna
Priya,

please clearely Explain what is STACK file,iam unable to understand what it is.

Thanks,


Thanks,
Kalyan.S
------------------------------------
WebFOCUS 7.1.4, Win XP SP2,
Oracle8i.
------------------------------------
September 05, 2006, 04:26 AM
<priya>
Kalyanswarna,

Ya Sorry for this brief description.Let me explain you in detail.
Suppose I create one stack "MonthStk" which consists of Month Names like Jan 2006,feb 2006 etc.I just want to retieve this stack data one by one with the help of REPEAT loop and Put it into an hold File.


TABLE FILE EMPDATA
SUM SALARY
BY FIRSTNAME
ON TABLE HOLD AS TEST_HOLD
END

? HOLD TEST_HOLD

MAINTAIN FILE TEST_HOLD
FOR ALL NEXT FIRSTNAME INTO EMPSTK;
COMPUTE I/I2=1;

REPEAT EMPSTK.FOCCOUNT
TYPE EMPSTK(i).FIRSTNAME;
COMPUTE I=I+1;
-*ON HOLD TABLE AS HOLD_NEW;
ENDREPEAT
END

Like in this code I created one stack and when I am accessing this stack in the REPEAT loop I want to put it into Hold File.

Is it possible or not?

regards,
Priya
September 05, 2006, 09:31 AM
Maintain Wizard
Priya
While you cannot issue a HOLD command from inside of Maintain, you can do a TYPE ON DDNAME to save the data to a flat file. You could also INCLUDE the data to a FOCUS / SQL file. In either case, you would just have to have the Master File Description created first.

TABLE FILE EMPDATA
SUM SALARY
BY FIRSTNAME
ON TABLE HOLD AS TEST_HOLD
END

? HOLD TEST_HOLD

MAINTAIN FILE TEST_HOLD AND HOLD_NEW
FOR ALL NEXT TEST_HOLD.FIRSTNAME INTO EMPSTK;
COMPUTE I/I2=1;

REPEAT EMPSTK.FOCCOUNT
TYPE EMPSTK(i).FIRSTNAME;
COMPUTE I=I+1;
INCLUDE HOLD_NEW.FIRSTNAME FROM EMPSTK(I)
-*ON HOLD TABLE AS HOLD_NEW;
ENDREPEAT
END

I hope this helps.

Mark