Changes can be made to multiple views using the Sequel command DSPVIEWD along with Find and Replace in SEU. This method is used most often when the name of a data library is changed, and you want your views to use the new library.Steps
Follow these steps to perform a find and replace for multiple SEQUEL views.
- Enter the following to change the REPLACE default for the SEQUEL Create View command:
CHGCMDDFT CMD(SEQUEL/CRTVIEW) NEWDFT(‘REPLACE(*YES)’)
- Use the Display View Description command to create a source file containing the view definitions for the views you want to change. This example will process all the views in the SEQUELEX library.
DSPVIEWD VIEW(SEQUELEX/*ALL) TYPE(*SRC) OUTPUT(*OUTFILE) OUTFILE(QTEMP/QXLSRC) OUTMBR(ALLVIEWS)
- Enter the command below to start Source Edit Utility using the source file created in step 2.
STRSEU SRCFILE(QTEMP/QXLSRC) SRCMBR(ALLVIEWS) OPTION(2)
- The source file will display in edit mode. Use F14 (Find/Change) to make changes in your source file. You can change a library name, a file name, and so on.
- Compile the program using CRTCLPGM or PDM.
- Run the program using the CALL command. All the views specified in the source file will be recre- ated along with any changes.
- Enter the command below to reset the CRTVIEW default values:
CHGCMDDFT CMD(SEQUEL/CRTVIEW) NEWDFT(‘REPLACE(*NO)’)