IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [SOLVED] appending records to hold file
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Platinum Member
Posted
Is there an easy way to append records to a 3-field hold file without having to do a modify routine or -READ / -WRITE? -READ and -WRITE are somewhat unpredictable in this environment. If there's no other way than to use modify or -READ and -WRITE, then please present your suggestions.

Thank you,

John

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


WF 7.6.5, Windows XP, HTML, Excel, PDF
 
Posts: 100 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
If it's a HOLD FORMAT FOCUS, you'd have to use Modify (or Maintain).

If a flat HOLD file, get the filedef attributes for the ddname, reissue the filedef with APPEND, and SAVE (if HOLD was format alpha) or SAVB (if binary) to the ddname. Test and inspect to make certain the old and new rows line up.

See How to Assign a Logical Name With Code Under Windows for FILEDEF syntax.

But note that you could run into trouble reporting, if the extended file is no longer sorted overall in conformity with the SEGTYPE in the Hold MFD.


- Jack Gross
WF 7.6.7, Win
 
Posts: 534 | Location: NYC | Registered: January 11, 2005Reply With QuoteEdit or Delete MessageReport This Post
JG
Master
Posted Hide Post
quote:
-READ and -WRITE are somewhat unpredictable in this environment


That's an extremely strange statement. Why?
 
Posts: 945 | Registered: February 24, 2005Reply With QuoteEdit or Delete MessageReport This Post
Gold member
Posted Hide Post
You can have a common master file, then hold data to different files. Then issue use command

USE
FILEA AS COMMONMASTER
FILEB AS COMMONMASTER
END

Another easy way is to use (APPEND. Here is the sample code.

FILEDEF HOLD DISK HOLD.FTM (APPEND
TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD
END
TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ 'JAPAN'
ON TABLE HOLD
END
TABLE FILE HOLD
PRINT *
END
 
Posts: 71 | Location: Omaha, NE | Registered: June 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
the FILEDEF with APPEND the Lusheng suggests if the answer you're looking for, but there are several other options as well.


Regards,

Darin



WF Server: 7.1.6 on Z/OS and Linux, ReportCaster, Self-Service, MRE, Java
Data: DB2, DB2/UDB, Adabas, SQL Server Output: HTML,PDF,Excel2K
WF Client: Linux w/WebSphere, Servlet, CGI
 
Posts: 1306 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
JG -- Yes, that is a strange statement. It's probably due to the way all the WebFOCUS are configured, and which version each one is. And I have no control over that.


WF 7.6.5, Windows XP, HTML, Excel, PDF
 
Posts: 100 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
Darin, Please share your other techniques.


WF 7.6.5, Windows XP, HTML, Excel, PDF
 
Posts: 100 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
You could also use the MORE Statement. What it requires is the two files have the same column names.
TABLE FILE FILE1
PRINT FIELD2
BY FIELD1
ON TABLE HOLD
MORE
FILE FILE2
END


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 386 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
John B

One great technic that helped me a lot is following some courses.
Your remarks and question give me the idea you just started with WebFocus.




Frank

prod: WF 7.6.5 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.5 on the same platform and databases,IE7

 
Posts: 1640 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Like almost everyone else has suggested, use MORE:

SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
SET ASNAMES=ON
-RUN

TABLE FILE BLAHBLAH34
PRINT
COL1 COL2 COL3
ON TABLE HOLD AS H001
END
-RUN

TABLE FILE BLINGBLING121
PRINT
COL1 COL2 COL3
ON TABLE HOLD AS H002
END
-RUN

TABLE FILE BOINGBOING96
PRINT
APPLE AS COL1
BANANA AS COL2
ORANGE AS COL3
ON TABLE HOLD AS H003
END
-RUN

TABLE FIL1 H001
PRINT COL1 COL2 COL3
ON TABLE HOLD AS H101
MORE
FILE H002
MORE
FILE H003
END
-RUN


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
quote:
-READ and -WRITE


You shouldn't have any problems with -READ and -WRITE if the program is coded correctly. If you're mixing -READ and -WRITE in the same Dialogue Manager loop, or if there is non-Dialogue Manager code within the loop, use the NOCLOSE option.

quote:
NOCLOSE - Keeps the external file open until the -READ operation is complete. Files kept open with NOCLOSE can be closed using the command -CLOSE filename. The option NOCLOSE is available only in OS/390.


It's strange the WF v5.3.2 documentation states "The option NOCLOSE is available only in OS/390" because that is not true.


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
and thank heavens that statement isn't true Wink




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2630 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [SOLVED] appending records to hold file

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.