How to retain existing data when you change physical files created from a 2E model?

Document ID : KB000020069
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

Physical files created from a 2E model will often contain data that should be kept. When these files need to change, this document describes a method to retain this data; you can also make this behavior the default for your 2E environment.

Question:  

How to retain existing data when you change physical files created  from a 2E model?

Answer:  

There are 2 model values that control this action:

  • YOLDLIB - Name of the library into which you want old physical files archived
  • YCPYLIB - Name of the library from which you want physical file data copied during the generation process

Normally these two model values are the same because you store data in an archive library and then copy the data back from the same library.

First create an archive library for this process (I refer to this as arc-lib):
CRTLIB LIB(arc-lib) TYPE(*TEST) TEXT('Archive library for my model')

Change the model values YOLDLIB and YCPYLIB to be arc-lib:
YCHGMDLVAL MDLVAL(YOLDLIB) VALUE(arc-lib)
YCHGMDLVAL MDLVAL(YCPYLIB) VALUE(arc-lib)

Use YEDTLIBLST to edit your model's interactive and batch JOBD library lists to include the archive library.

If you have changed a physical file and want to retain its data:

  • Add the physical file and any dependent logical files to your job list
  • From the Services Menu, use F4 to prompt option 1 [Submit model create request (YSBMMDLCRT)]
  • F10 to display all parameters
  • Page down to the parameters Library to copy data from (CPYLIB) and Data archive library (OLDLIB)
  • Change the values *NONE to *CPYLIB and OLDLIB respectively

If you wish, you can make CPYLIB(*CPYLIB) and OLDLIB (*OLDLIB) the defaults for your 2E installation.

Change the command defaults for YSBMMDLCRT with:

  • CHGCMDDFT CMD(YSBMMDLCRT) NEWDFT('CPYLIB(*CPYLIB) OLDLIB(*OLDLIB)') 

For the command YSBMMDLCRT called from option 1 of the Services Menu:

  • Use WRKMSGD MSGID(Y2R0030) MSGF(Y2MSG)
  • Option 5 to Display details then option 1 to Display message text
  • The shipped Second level message text is YSBMMDLCRT JOBLST(&2/&1) EDIT(*YES)
  • Option 2 to Change the message Y2R0030
  • Change  the Second-level message text to YSBMMDLCRT JOBLST(&2/&1) EDIT(*YES) CPYLIB(*CPYLIB) OLDLIB(*OLDLIB)
  • Check that this is now the new default for option 1 [Submit model create request (YSBMMDLCRT)] from the Services Menu

Additional Information: 

  • When you install a new 2E release, you will need to make the changes to the command defaults of YSBMMDLCRT and message Y2R0030.   
  • If a new version of Y2MSG is shipped in a cumulative PTF, you will need to make the change to message Y2R0030.