Page 1 of 1

B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 12:22 am
by PJAlarcon
Hi,
a little background...
System is a mainframe z/OS
Need to update some records from a VSAM KSDS file, the field to be updated is not part of any key.
I have the following pgm

FILE MASTER VS(UPDATE)
     MKEY   1  12 A
     AXCOLL 84 6  A
FILE INFILE
     IKEY   1  12 A
JOB INPUT NULL
GET INFILE
DO WHILE NOT EOF INFILE
  READ MASTER KEY INFILE:IKEY STATUS
  IF MASTER:FILE-STATUS NE 0
    DISPLAY 'ERROR READING: ' MASTER:AXCOLL
  ELSE
    IF MASTER:AXCOLL = 'some-literal'
      MOVE 'another-literal' TO MASTER:AXCOLL
    END-IF
    WRITE MASTER UPDATE
    IF MASTER:FILE-STATUS NE 0
      DISPLAY 'ERROR WRITING: ' MASTER:AXCOLL
    END-IF
  END-IF
  GET INFILE
END-DO


According to the Easytrieve Reference Guide I need to override the installation option/parameter UPDTVS to YES, which is set to NO by default.
I tried several things but keep receiving B017.
What I tried:
inside the pgm code: (got invalid parm every time)
PARM UPDTVS=YES
PARM UPDTVS (YES)
PARM UPDTVS (Y)

in the JCL EXEC line: (didn't work)
EXEC PGM=EZTPA00,PARM='UPDTVS=YES'

Does anyone knows how to get this thing working? How do I override the installation options? (like the guide instructs)

Pablo.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 1:52 am
by Robert Sample
It looks like
PARM UPDTVS Y
would do it.

However, this is a vendor product. If your site is licensed to use the product, you are entitled to support from the vendor. The BEST source of an answer to your question will be the vendor, either by looking at the vendor's support site for topics about UPDTVS or by raising an issue for the vendor to address. Then you should be checking with your coworkers, as they have likely run into the same issue in the past. This forum shoulod be pretty much the LAST place you ask.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 2:43 am
by PJAlarcon
Thank you Robert for your prompt response.
We're licensed, I've read the guide, asked coworkers, explored vendor's site, didn't contact vendor though (yet), THEN I posted in the forum.
References to this topic on vendor's site is almost nil.
It is true I didn't contact vendor prior to my post, but you know... (with all due respect, and don't take it personal) is very discouraging to read...
This forum shoulod be pretty much the LAST place you ask

on a forum which motto is
A Help & Support Forum for Mainframe Beginners and Students

Blame me for wanting to exhaust all posibilities.

BTW, your suggestion didn't work.
PARM UPDTVS Y
*******B029 PARAMETER IS INVALID - UPDTVS
*******B029 PARAMETER IS INVALID - Y

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 3:02 am
by Akatsukami
PJAlarcon wrote:Thank you Robert for your prompt response.
We're licensed, I've read the guide, asked coworkers, explored vendor's site, didn't contact vendor though (yet), THEN I posted in the forum.
References to this topic on vendor's site is almost nil.
It is true I didn't contact vendor prior to my post, but you know... (with all due respect, and don't take it personal) is very discouraging to read...
This forum shoulod be pretty much the LAST place you ask

on a forum which motto is
A Help & Support Forum for Mainframe Beginners and Students

Blame me for wanting to exhaust all posibilities.

There are a distressing number of querents who, for whatever reasons, skip the bolded actions and proceed directly to asking questions on this and similar boards. As with another profession that shall go nameless for the moment, ninety percent of the querents give the other ten percent a bad name. You're a member of the ten percent :)

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 3:38 am
by BillyBoyo
It is an installation option which cannot be overridden by any value on the Easytrieve Plus PARM statement.

You are going to need to to tell your boss so that someone can consult with the Sysprogs responsible for installing it.

The options table EZTPOPT needs to be changed, and you should not do that yourself.

It would be left as "NO" usually for reporting-only functions for MIS and user-written reports.

If they are unable to change the EZTPOPT that you are using, they should be able to set up another library for you with a customised version.

Full details will be in the installation/customisation guide, which your Sysprogs will have.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 4:13 am
by BillyBoyo
You don't show a STOP in your program. Means it won't stop.

You can use the automatic input, instead of the GET and the DO.

    JOB INPUT INFILE
      READ MASTER KEY INFILE:IKEY STATUS
      IF MASTER:FILE-STATUS NE 0
        DISPLAY 'ERROR READING: ' MASTER:AXCOLL
      ELSE
        IF MASTER:AXCOLL = 'some-literal'
          MOVE 'another-literal' TO MASTER:AXCOLL
        END-IF
        WRITE MASTER UPDATE
        IF MASTER:FILE-STATUS NE 0
          DISPLAY 'ERROR WRITING: ' MASTER:AXCOLL
        END-IF
      END-IF


You don't specify STATUS for the WRITE, so Easytrieve will give you an automatic message, and you won't see yours.

You WRITE irrespective of the record being changed. It'll save some resources to do it conditionally.

You reference a field on MASTER if you have failed to read it. This will cause the program to fail at that point.

    JOB INPUT INFILE
      READ MASTER KEY INFILE:IKEY STATUS
      IF NOT MASTER
        DISPLAY 'ERROR READING: ' IKEY
        GO TO JOB
      END-IF
      IF MASTER:AXCOLL = 'some-literal'
          MOVE 'another-literal' TO MASTER:AXCOLL
         WRITE MASTER UPDATE STATUS
        IF MASTER:FILE-STATUS NE 0
          DISPLAY 'ERROR WRITING: ' IKEY " " MASTER:AXCOLL
        END-IF
      END-IF
 


This JOB, using the autormatic input, will stop on its own. Less code to look at. Easier to spot any problems.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 4:39 am
by PJAlarcon
Thanks Billy,
I'm just starting with Easytrieve, and these are valuable observations.

I don't think I will have any luck changing installation options. Probably I'll have to go the hard way, by unloading to PS and updating with SORT, tthen IDCAMS DEFINE and REPRO...
I was trying to find a more efficient way by updating records retrieveing them by key and then writing them back to the VSAM file.

What misled me was some paragraphs in the Reference Guide, about the possibilty to override environments options temporarily.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Sat Nov 02, 2013 5:16 am
by BillyBoyo
Some options you can override. Those in the Chapter on the Environment, where the Eaystrieve Plus PARM is documented, can be. The others can't.

Let your boss know that you won't be able to update VSAM files with Easytrieve Plus. You never know.

Alternative: SORT to COPY to a PS. SORT to read the PS, make the changes and write to the VSAM. You only need to DELETE/DEFINE if the file is not reusable. SORT is much faster than IDCAMS REPRO.

If you are used to COBOL, be careful. Don't assume that stuff which looks like COBOL (like MOVE) works like COBOL. Use assignments (=) and save MOVE for files and if you need variable-length fields.

Re: B017 VSAM UPDATE IS NOT ALLOWED

PostPosted: Mon Nov 04, 2013 4:42 am
by dick scherrer
Hello,

My connection to the system that runs a Lot of VSAM is not available until tomorrow. I'm about 99% sure that that application reads and updates VSAM records on-the-fly. I don't know if there has been any customization, but (iirc) several Easytrieve processes do this.