In my FEX where I'm trying to use MODIFY logic to add new records to a flat file, I am getting the following:
END
(FOC1110) ATTEMPT TO DELETE,UPDATE OR INCLUDE NON-WRITABLE SEGMENT
(FOC1110) ATTEMPT TO DELETE,UPDATE OR INCLUDE NON-WRITABLE SEGMENT
(FOC1110) ATTEMPT TO DELETE,UPDATE OR INCLUDE NON-WRITABLE SEGMENT
(FOC1110) ATTEMPT TO DELETE,UPDATE OR INCLUDE NON-WRITABLE SEGMENT
Here is my code snippet:
TABLE FILE PALSSTD
-*
WRITE
-*
STU_ID AS STU_ID
AA003 AS STU_NAME
CMP AS CMP
BY CMP NOPRINT
BY STU_ID NOPRINT
BY AA003 NOPRINT
WHERE CMP NE ' '
-*
ON TABLE HOLD AS R195CURR
END
-RUN
-*
MODIFY FILE R195PREV
FIXFORM FROM R195CURR
MATCH CMP STU_ID
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA ON R195CURR
END
-RUN
Here is my Master for the file I'm trying to add records to:
You could add new records to the flat file by appending to the existing file using FILEDEF (append.
Alternatively, you could create a Master and a blank FOCUS database and use MODIFY every day to update the FOCUS database.
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
August 27, 2009, 06:10 AM
Danny-SRL
Webmeister,
Yes, using a FOCUS file would make things easier. However, if this is not an option, then MATCH FILE would be useful:
MATCH FILE PALSSTD
WRITE
STU_ID AS STU_ID
AA003 AS STU_NAME
CMP AS CMP
BY CMP NOPRINT
BY STU_ID NOPRINT
BY AA003 NOPRINT
WHERE CMP NE ' '
RUN
FILE R195PREV
COUNT AA003
BY CMP
BY STU_ID
AFTER MATCH HOLD AS R195CURR OLD-NOT-NEW
END
-RUN
FILEDEF R195PREV DISK R195PREV.FTM (APPEND
-* I suppose that this is the name of your R195 file...
TABLEF FILE R195CURR
PRINT CMP STU_ID AA003
ON TABLE HOLD AS R195PREV
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
August 27, 2009, 10:11 AM
Rhonda
You cannot MODIFY a flat file. MODIFY was originally designed for FOCUS files. You can use MODIFY on RDBMS files as well.
WebFOCUS & ReportCaster 8.1.05, 7.7.03 - AIX/LINUX, FOCUS 7.6.13 MVS, Output PDF, XLS-XLSX, DOCX and HTML
August 27, 2009, 10:18 AM
Rhonda
Hi Francis, You can use MAINTAIN to update a flatfile (Suffix = FIX)if that is really what you want to do.
WebFOCUS & ReportCaster 8.1.05, 7.7.03 - AIX/LINUX, FOCUS 7.6.13 MVS, Output PDF, XLS-XLSX, DOCX and HTML
August 27, 2009, 10:23 AM
Francis Mariani
You can use Maintain if you have a license for Maintain
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
August 27, 2009, 11:09 AM
webmeister
Danny,
Thank you for your sample code... I'm working on trying to get it working.
To everyone else who has replied, thank you so much for your willingness to help.
Question: is there an MVS/TSO equivalent to FILEDEF?
(Headslap) - Duh! Thank you.... sometimes it's the little things that are the largest headaches.
I think I'll make a book of all the helpful assists, ideas and suggestions received.
Mainframe FOCUS 7.0 VM/CMS and MVS/TSO
August 27, 2009, 12:41 PM
webmeister
Tom,
Excuse my ignorance, but what is the DYNAM ALLOC line of code to be able to add records to the file, and not overwrite what is already on the file? I only ask because I haven't done this before.
Thank you......
Mainframe FOCUS 7.0 VM/CMS and MVS/TSO
August 27, 2009, 12:49 PM
Tom Flynn
DYNAM ALLOC DD WEBMAN DS YOUR.DATASET.NAME.HERE.DATA MOD REUSE -RUN OR
Web, it might be useful for you to download a copy of a mainframe FOCUS manual. There is a chapter in the back called "MVS/TSO Guide to Operations". This chapter, which isn't that long, has detailed instructions on DYNAM ALLOC and other DYNAM commands you might find useful. It will also give you a good idea on how FOCUS operates in a mainframe environment. I think a little reading now will save you many headaches in the future.