Focal Point
[SOLVED] Getting errors within "Modify"

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

August 26, 2009, 04:08 PM
webmeister
[SOLVED] Getting errors within "Modify"
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:

  FILE=R195PREV   ,SUFFIX=FIX                                             
 SEGNAME=ROOT    ,SEGTYPE=S0                                             
   FIELD=CMP           ,R195010 ,A03 ,A03 ,TITLE='CAMPUS,NAME'         ,$
   FIELD=STU_ID        ,R195020 ,A09 ,A09 ,TITLE='STUDENT,ID'          ,$
   FIELD=STU_NAME      ,R195030 ,A32 ,A32 ,TITLE='STUDENT,NAME'        ,$
 


If anyone has an idea or two, I'd be happy to hear from you. Thanks in advance.

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
August 26, 2009, 04:12 PM
Francis Mariani
You cannot use MODIFY to update a flat file.

Why don't you modify the code to generate the desired flat 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
August 26, 2009, 05:19 PM
webmeister
Hi, Francis,

I could, but once I get the "PREV" file created, I want to be able to only add new records to it each day; I don't want to create it every day.

Also, if I can't use MODIFY to update a flat file, what type of file can I create that I can use a MODIFY on? FOCUS?

Thanks for replying - it's appreciated.


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
August 26, 2009, 05:28 PM
GinnyJakes
That is correct. It would have to be a FOCUS file. Or a relational table for which you have a write adapter license.


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
August 26, 2009, 05:30 PM
Francis Mariani
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 Smiler


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?


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
August 27, 2009, 11:20 AM
Tom Flynn
DYNAM ALLOC


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 27, 2009, 12:19 PM
webmeister
(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

in JCL:

//WEBMAN DD DSN=YOUR.DATASET.NAME.HERE.DATA, DISP=MOD


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 27, 2009, 12:53 PM
webmeister
Thank you again.


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
August 27, 2009, 12:54 PM
Tony A
Search link top right will give you more results than you are likely to get in the same time.

You can also use TSO ALLOC - slightly different, similar job.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 27, 2009, 12:56 PM
Tom Flynn
Web, welcome...


Hey T,

Do you know what happend to F. Dutch?? Haven't seen him on for a loooonnnggg time!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 27, 2009, 02:09 PM
GinnyJakes
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.


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