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,
JohnThis message has been edited. Last edited by: Kerry,
WF 7.7.03, Windows 7, HTML, Excel, PDF
September 08, 2008, 07:14 PM
j.gross
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.
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 through 8.1.05
September 09, 2008, 01:40 AM
<JG>
quote:
-READ and -WRITE are somewhat unpredictable in this environment
That's an extremely strange statement. Why?
September 09, 2008, 10:15 AM
Lusheng
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
September 09, 2008, 11:29 AM
Darin Lee
the FILEDEF with APPEND the Lusheng suggests if the answer you're looking for, but there are several other options as well.
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
September 09, 2008, 02:06 PM
JohnB
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.7.03, Windows 7, HTML, Excel, PDF
September 09, 2008, 02:07 PM
JohnB
Darin, Please share your other techniques.
WF 7.7.03, Windows 7, HTML, Excel, PDF
September 09, 2008, 05:31 PM
Waz
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.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
September 10, 2008, 02:12 AM
FrankDutch
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.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
September 10, 2008, 10:26 AM
Francis Mariani
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
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 10, 2008, 10:31 AM
Francis Mariani
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
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 10, 2008, 10:51 AM
susannah
and thank heavens that statement isn't true
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 27, 2015, 04:50 PM
Doug
This is a good refresher, even years last...
May 27, 2015, 05:08 PM
Francis Mariani
You wouldn't have to worry if only you used the GUI
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