Saturday, November 17, 2012

File-Aid: Copying Selected PDS Members



Chapter 7. Copying Selected PDS Members

File-AID has a powerful utility for copying all or a selected subset of records from any MVS file. The "From" file and the "To" file can be different file types (for example, from VSAM to PDS member). The Copy utility provides this ability and has special features for copying partitioned data sets (PDS) including member selection based on ISPF statistics like "last changed date".
The Copy utility lets you optionally use standard File-AID selection criteria during the Copy. You may use existing selection criteria defined with the Selection utility (Option 6), or dynamically create temporary selection criteria.
In this chapter, you practice using the Copy utility to selectively copy (and rename) PDS members based on member name and data content.

7.1 Accessing the Copy Utility (Option 3.3)

The Copy utility is located on File-AID's Extended Utilities menu (option 3) as utility number 3.
Step:
  1. From the File-AID Primary Option Menu (not shown here), select File-AID option 3.3 to access the Copy Utility entry screen (Figure 7-1).

7.2 Defining Your Copy Request

The Copy Utility entry screen (see Figure 7-1) captures:
  • From Dataset
  • To Dataset
  • Processing option (online or batch)
  • Selection Criteria usage (and optionally a selection criteria dataset and member name).
You may either perform the Copy processing online at your terminal, or generate JCL for File-AID/Batch execution to run your request as a background job in MVS.
Figure 7-1. Copy Utility Entry Screen
+--------------------------------------------------------------------------------+
| File-AID ---------------------  Copy Utility  ---------------------------------|
| COMMAND ===>                                                                   |
|                                                                                |
| Specify "FROM" Dataset Information:                                            |
|    Dataset name   ===> FASAMP.JCL                                              |
|    Volume serial  ===>          (If not cataloged)                             |
|                                                                                |
| Specify "TO" Dataset Information:                                              |
|    Dataset name   ===> FASAMP.LAYOUTS                                          |
|    Volume serial  ===>          (If not cataloged)                             |
|    Disposition    ===> OLD      (OLD, MOD, NEW)                                |
|                                                                                |
|                                                                                |
| Specify Execution Information:                                                 |
|    Process online or batch    ===> B        (O = Online; B = Batch)            |
|                                                                                |
| Specify Selection Criteria Information:     (E = Existing; T = Temporary;      |
|    Selection criteria usage   ===> T         M = Modify; Q = Quick; N = None)  |
|    Selection criteria dataset ===>                                             |
|    Member name                ===>          (Blank or pattern for member list) |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

7.3 Specifying a Copy of Selected Members

This example shows how to set up batch JCL to copy selected members of your sample JCL library (FASAMP.JCL) to your sample record layouts library (FASAMP.LAYOUTS). Only members with names between SPACE and USER, that execute program name FILEAID (for example, EXEC PGM=FILEAID), are copied. A new member name is assigned in the target PDS by appending an X to the original member name (for example, SPACEX, USERX).
Steps:
  1. Make sure the FROM dataset name is FASAMP.JCL (no member name).
  2. Overtype the TO dataset name to read FASAMP.LAYOUTS.
  3. Type B in the Process online or batch field.
  4. Type T in the Selection criteria usage field.
  5. Press <Enter>.
More About the Copy Utility Screen
  • Standard File-AID dataset and member name entry is supported including using wildcard characters in the dataset names (for example, FASAMP.*) or "FROM" member name (for example, FASAMP.JCL(CNV*)).
  • The FROM and TO datasets can be different types and record lengths. A Confirm Copy screen may be displayed to warn you of differences and potential record truncation or padding.
  • When selection criteria usage is T (Create temporary), Q (Quick temporary) or N (None), the Selection criteria dataset and member are not validated or used. For E (Use existing) or M (Modify existing), a valid selection criteria dataset and member must be provided.
  • When processing a PDS, a member name of asterisk (*) means to copy all members matching your selection criteria. Otherwise, the PDS Processing Options (PPO) screen is always presented to let you specify member handling options.

7.4 Using PDS Member Processing and Selection Features

When your "FROM" (and "TO") dataset(s) are partitioned (PDS), special member processing is automatically provided.
"FROM" PDS Member Processing
  • You may specify JCL format processing.
  • You may specify copying of complete members or just records in each member that match your selection criteria.
  • You may select all members or a subset of members based on:
    • Member name
      • Name mask (for example, A?B or AB*)
      • Name range (for example, From AB to BZZZZZ)
    • ISPF statistics
      • Date last modified range
      • Date created range
      • Last modified user ID range
    • Manual selection and/or exclusion of individual members from a list of members matching your member criteria.
  • You can also leave the fields blank and press <Enter> to select all members (the default).
"TO" PDS Member Processing
If your "TO" dataset is also a PDS, you may specify options to control:
  • Copying of empty members
  • Renaming of members based on a name mask
  • Replacement of existing members.
Specifying PPO Options
The PDS Processing Options (PPO) screen (see Figure 7-2) lets you define a subset of members to be copied based on member name and/or ISPF statistics.
It also can be used to specify member renaming and other options for copied members.
Figure 7-2. Copy Utility - PDS to PDS Processing Options Screen
+--------------------------------------------------------------------------------+
| File-AID ----------------- PDS Processing Options -----------------------------|
| COMMAND ===>                                                                   |
|                                                                                |
| FROM Dataset: USERID9.FASAMP.JCL                                               |
|     Copy entire member            ===> Y        (Y = Yes;                      |
|                                                  N = No, selected records only)|
|     Copy empty members            ===> N        (Y = Yes; N = No)              |
|     Process in JCL format         ===> N        (Y = Yes; N = No)              |
|                                                                                |
| TO Dataset:   USERID9.FASAMP.LAYOUTS                                           |
|     Replace like-named members    ===> Y        (Y = Yes; N = No)              |
|                                                                                |
|     Rename copied members mask    ===> ???????X                                |
|                                                                                |
| Specify Member Selection Options (Blank for All Members)                       |
|     Member name mask              ===>                                         |
|     Member name range             ===> SPACE    to ===> USER                   |
|     Last modified userid          ===>          to ===>                        |
|     Creation date                 ===>          to ===>            (YY/MM/DD)  |
|     Modification date             ===>          to ===>            (YY/MM/DD)  |
|                                                                                |
|     Display member selection list ===> N        (Y = Yes; N = No)              |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Steps:
  1. Type ???????X in the Rename copied members mask field. A question mark (?) means to keep original member name character.
  2. Type SPACE in the "Member name range" (from) and USER in the "to" field.
  3. Type an N in the Display member selection list field.
  4. Press <Enter>.
More About the Copy PPO Screen
  • If a member mask was specified on the entry screen for the FROM dataset (for example, FASAMP.JCL(CNV*)), File-AID automatically copies the mask (CNV*) to the Member name mask field, ready for selection.
  • If you are scanning JCL members and looking for multiple conditions within a single statement (for example, DISP=OLD and UNIT=TAPE), use Process In JCL format=Y.
  • Use option 0.4 (Processing Parameters) to establish permanent choices for options like Replace like-named members and Copy entire member and Display member selection list fields.
  • See "Using the Manual Member S/X Selection List" for examples of using the member selection list.

7.5 Specifying Temporary Selection Criteria

When you have chosen selection criteria usage T (Create Temporary), the next screen displayed is the Selection Criteria Menu screen (TEMPORARY) as shown in Figure 7-3. You use this screen to access the selection criteria screens to specify what data condition(s) you are looking for in a member in order for that member to be copied.
In this example, you are looking for a JCL statement containing the string PGM=FILEAID. You define this test using Unformatted Selection Criteria. First, you request access to the Unformatted Selection Criteria screen.
Steps:
  1. Type 3 on the OPTION line to Edit unformatted selection criteria.
  2. Press <Enter>.
Figure 7-3. Copy Utility - TEMPORARY Selection Criteria Menu Screen
+--------------------------------------------------------------------------------+
| File-AID - Selection Criteria Menu - TEMPORARY --------------------------------|
| OPTION ===> 3                                                                  |
|                                                                - Status -      |
|       1  OPTIONS      - Enter selection criteria options         default       |
|       2  FORMATTED    - Edit formatted selection criteria        0   sets      |
|       3  UNFORMATTED  - Edit unformatted selection criteria      0   sets      |
|                                                                                |
|                                                                                |
| Member list description ===> ______________________________                    |
|                                                                                |
|     Long    ===> ______________________________________________________________|
| Description ===> ______________________________________________________________|
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
| Use VIEW command to display selection criteria summary                         |
| Use SAVE command to write selection criteria request                           |
| Use END to continue processing                                                 |
| Use CANCEL to return to main panel                                             |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

More About the Selection Criteria Menu Screen
  • When processing a PDS, do not use option 1 (OPTIONS). There are no selection criteria options that are applicable to PDS copying.

7.6 Specifying the Unformatted Data Test

You use the CO (Contains) relational operator (RO) to specify a scan of each statement starting at Position 1. No length is specified because File-AID defaults the length of a scan to: "end of the record".
Steps:
  1. On the first line type 1 in the Position column.
  2. Type CO in the RO column.
  3. Type PGM=FILEAID in the Data Value area.
  4. Press <Enter>.
  5. Use the END command or PF key (default PF3) to return to the selection criteria menu.
Figure 7-4. Copy Utility - Unformatted Field Selection Criteria Screen
+--------------------------------------------------------------------------------+
| File-AID -------------  Unformatted Selection Criteria  ---  ROW 1 TO 16 OF 25 |
| COMMAND ===> END                                              SCROLL ===> CSR  |
|                                                                                |
| Use END command to continue, use CANCEL command to return to main screen.      |
|                                                                                |
|     AND                                                                        |
| Cmd /OR Position Length RO                      Data Value                     |
| --- --- -------- ------ -- ----------------------------------------------------|
| ___      1____   _____  CO PGM=FILEAID_________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
| ___ AND  _____   _____  EQ ____________________________________________________|
|                                                                                |
+--------------------------------------------------------------------------------+

More About Unformatted Selection Criteria
  • When you specify CO or EQ relational operators, you can look for multiple strings by separating the strings with commas (for example, ABC,DEF,GHI looks for ABC or DEF or GHI at the specified position).
  • Since this example defines unformatted selection criteria only, you could have come directly to this screen by using the Q (Quick) selection criteria usage code on the main Copy screen. When you use the Q (Quick) option, the Selection Criteria Menu screen does not appear and processing occurs immediately after you END from this Unformatted Selection Criteria screen.

7.7 Ending Selection Criteria Specification

After returning to the Selection Criteria Menu, use the END command to continue your Copy processing. Notice that the Status for UNFORMATTED shows "1 sets".
Figure 7-5. Copy Utility - End Criteria Specification - Begin Copy
+--------------------------------------------------------------------------------+
| File-AID - Selection Criteria Menu - TEMPORARY --------------------------------|
| OPTION ===> END                                                                |
|                                                                - Status -      |
|       1  OPTIONS      - Enter selection criteria options         default       |
|       2  FORMATTED    - Edit formatted selection criteria        0   sets      |
|       3  UNFORMATTED  - Edit unformatted selection criteria      1   sets      |
|                                                                                |
|                                                                                |
| Member list description ===> ______________________________                    |
|                                                                                |
|     Long    ===> ______________________________________________________________|
| Description ===> ______________________________________________________________|
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
| Use VIEW command to display selection criteria summary                         |
| Use SAVE command to write selection criteria request                           |
| Use END to continue processing                                                 |
| Use CANCEL to return to main panel                                             |
|                                                                                |
+--------------------------------------------------------------------------------+

Step:
  1. Use the END command (PF3) to proceed with PDS scanning and member copying (or batch JCL generation).

7.8 Generate Batch JCL

Because you requested batch processing, the COPY - JCL Specification screen is displayed next. If you had requested online processing, your copy would execute immediately and you would be returned to the Copy Utility entry screen with a message indicating the results of your copy.
The COPY - JCL Specification screen is similar to many batch JCL screens in File-AID. The JOB statement is saved from screen to screen and session to session. You have several options:
  • Enter the SUBMIT command to generate the JCL and submit the job.
  • Enter the JCL command to generate the JCL and place it in a temporary work file that you are Editing.
  • Enter the END command to exit without JCL generation or submission.
Figure 7-6. Copy Utility - COPY - JCL Specification
+--------------------------------------------------------------------------------+
| File-AID ---------------- COPY - JCL Specification  ---------------------------|
| COMMAND ===> JCL                                                               |
|                                                                                |
| JCL Information for Batch Processing:                                          |
|                                                                                |
|  Sysout class    ===> *                                                        |
|                                                                                |
| JOB Statement Information:                                                     |
|  ===> //USERID9A JOB (ACCT,INFO),'FILE-AID',CLASS=A,                           |
|  ===> //   MSGCLASS=A,NOTIFY=USERID9                                           |
|  ===>                                                                          |
|  ===>                                                                          |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
| Use JCL command to edit generated JCL                                          |
| Use SUBMIT command to submit batch job                                         |
| Use END to return to main COPY panel without submitting job                    |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Steps:
  1. Type JCL on the command line to view the generated JCL.
  2. Press <Enter>.

7.9 Editing Your Generated Copy JCL

From the Edit session, you can use the CREATE or REPLACE primary command with the C999 line command to save the JCL to a PDS, and/or use the SUBMIT command to submit the JCL.
Step:
  1. After viewing the generated JCL, use the END command repeatedly until the File-AID Primary Option Menu screen is displayed.
Figure 7-7. Copy Utility - Generated JCL for Batch Processing
+--------------------------------------------------------------------------------+
| EDIT ---- SYS94138.T152845.RA000.USERID9.R0039174 ------------ COLUMNS 001 072 |
| COMMAND ===> END                                              SCROLL ===> CSR  |
| ****** ***************************** TOP OF DATA ******************************|
| 000001 //USERID9A JOB (ACCT,INFO),'FILE-AID',CLASS=A,                          |
| 000002 //   MSGCLASS=A,NOTIFY=USERID9                                          |
| 000003 //*  YOU ARE VIEWING JCL THAT FILE-AID HAS GENERATED TO PERFORM         |
| 000004 //*  THE REQUIRED FUNCTION. YOU CAN CHANGE THIS JCL IF DESIRED AND USE  |
| 000005 //*  THE SUBMIT PRIMARY COMMAND TO SUBMIT THE JOB. THE CREATE OR REPLACE|
| 000006 //*  PRIMARY COMMAND CAN BE USED TO KEEP THIS JOBSTREAM FOR FUTURE USE. |
| 000007 //*  USE THE END COMMAND TO EXIT THE FUNCTION WITHOUT SUBMITTING THE JOB|
| 000008 //FASTEP   EXEC PGM=FILEAID                                             |
| 000009 //STEPLIB  DD  DISP=SHR,DSN=CW.COMMON.FA.ALPHA.LOADLIB                  |
| 000010 //SYSPRINT DD  SYSOUT=*                                                 |
| 000011 //SYSLIST  DD  SYSOUT=*                                                 |
| 000012 //DD01     DD  DSN=USERID9.FASAMP.JCL,                                  |
| 000013 //             DISP=SHR                                                 |
| 000014 //DD01O    DD  DSN=USERID9.FASAMP.LAYOUTS,                              |
| 000015 //             DISP=OLD                                                 |
| 000016 //DD01SC   DD  DSN=USERID9.FILEAID.SC.D940518.T155703(SELECT),          |
| 000017 //             DISP=(OLD,DELETE)                                        |
| 000018 //SYSIN    DD  *                                                        |
| 000019 $$DD01 COPYMEM CEM=NO,RLM=YES,NEWMEMS=???????X,                         |
| 000020   MEMBER=(SPACE,TALLY,UPDATE,USER)                                      |
|                                                                                |
+--------------------------------------------------------------------------------+

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.