Skip to content

SERCOPY - Copy Utility

Program SERCOPY provides enhanced copy services for ChangeMan ZMF batch jobs and internal processes. Some copy functions are provided by proprietary programs, and other functions may be provided by calls to standard IBM copy utilities.

SERCOPY performs these functions:

  • Copy partitioned data set member.

  • Copy sequential data set.

  • Compress Expand compressed listings.

  • Add, reset, or update ISPF statistics

  • Dynamically reallocate PDS libraries during a copy function.

  • SERENQ, Enqueue/dequeue data set

SERCOPY Input

  • Partitioned data set or sequential data set.

  • Keyword parameters in the PARM statement.

  • Member names in the SYSIN statement.

Output

  • Members in partitioned data set.

  • SYSPRINT output.

Sample JCL

The following is a sample job fragment showing a SERCOPY step.

//SERCOPY EXEC  PGM=SERCOPY,    *** COPY CTST FROM STAGING
//              REGION=3M,
//              PARM=('INDSN(CMNTP.S6.ACTP.STG6.#000081.SRC)',
//              'MEMBER=CTST')
//SYSPRINT  DD  DISP=(,PASS),DSN=&&LIST00,
//              UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)
//ABNLIGNR  DD  DUMMY
//SYSUT2    DD  DISP=(,PASS),DSN=&&SOURCE(CTST),
//              UNIT=SYSDA,SPACE=(CYL,(1,2,1),RLSE),
//              DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSUT3    DD  UNIT=SYSDA,SPACE=(CYL,(5,5))
//SYSUT4    DD  UNIT=SYSDA,SPACE=(CYL,(5,5))

...

DD Statements

This table describes DD statements for SERCOPY.

DDNAME I/O Purpose
SYSIN Input Member list for copies if MEMBER keyword parameter is not coded in the PARM statement
SYSPRINT Output Report file that displays information from the execution of SERCOPY
SYSUT1 Input PDS if INDSN and INFILE keyword parameters are not coded in the PARM statement
SYSUT2 Output PDS if OUTDSN and OUTFILE keyword parameters are not coded in the PARM statement
SYSUT3 I/O Work data set
SYSUT4 I/O Work data set

...

The data set in DD statement SYSUT1 is dynamically allocated if keyword parameter INDSN or INFILE is coded in the PARM statement.

The data set in DD statement SYSUT2 is dynamically allocated if keyword parameter OUTDSN or OUTFILE is coded in the PARM statement.

PARM Options

The PARM parameter is required in the EXEC statement for SERCOPY. This table describes SERCOPY options that are input through the PARM parameter. Note that the default setting for the STATSA/STATSB/STATSE parameters (if these are not specified) is that the copied member will have the same type of statistics as the input member.

Parameter Description
ABEND ABEND if error is encountered.
ALIAS Copy all alias entries for members selected.
BSAM Perform internal copy rather than IEBCOPY.
COMPRESS(n) Compress data using compression type n. For low compression n=2. For high compression n=7.
CSTATS See the ISPF STATISTICS table below.
EXPAND Decompress data if compressed.
FULL Copy all members.
INDSN(dsname) Specifies DSN for input data set. If this parameter is specified, the input data set name is dynamically allocated. Mutually exclusive with parameter INFILE.
INFILE(ddname) Specifies ddname for input data set. Default is SYSUT1.
LIST List member names in IEBCOPY message output.
LMOD Copy using IEBCOPY COPYMOD.
MEMBER(mem,...) Specifies list of member names to be copied.
If this parameter is omitted, the member names are read from SYSIN statements containing one or more member names per line in free form format.
If this parameter is omitted and SYSIN is missing or empty, or if MEMBER() is specified, a FULL copy is performed.
Members can be renamed during the copy operation by specifying each member name to be renamed in the following format: oldname/newname
MFS Input is MFS data set with non-standard member names. This parameter forces the BSAM option.
MSTATS See the ISPF STATISTICS table below.
NOREPL Do not replace like named members.
OSTATS See the ISPF STATISTICS table below.
OUTDSN(dsname) Specifies DSN for output data set. If this parameter is specified, the output data set is dynamically allocated. Mutually exclusive with parameter OUTFILE.
OUTFILE(ddname) Specifies ddname for output data set. Default is SYSUT2.
PDSCOMP Compress after copy operation.
PRINT(ddname) Specifies ddname for output print data set. Default is SYSPRINT.
REALLOC Reallocate if more space required.
RETRY Retry on x37 abend (compress).
This parameter is incompatible with the AUTOCMPX=YES of PDSFAST®. See PDSFAST.
RSTATS See the ISPF STATISTICS table below.
STATSA Extended ISPF stats will be turned on automatically when the line count reaches 64k.
STATSB Basic ISPF stats will be set.
STATSE Extended ISPF stats will be set.
USERID(tsoid) Specifies the ID for ISPF statistics for copied members.
Statistics added to members with CSTATS parameter.
Statistics in all members copied with OSTATS parameter.
Statistics in all members copied with RSTATS parameter.
Statistics added to members with VSTATS parameter.
USTATS See the ISPF STATISTICS table below.
VSTATS See the ISPF STATISTICS table below.

...

ISPF STATISTICS

Option Name Size Created Changed ID Init Mod VV MM
CSTATS Input dir Input dir Input dir Input dir Input dir Input dir Input dir Input dir VV Input dir MM
MSTATS Input dir Input dir Input dir Current Current Input dir 0 Input dir VV Input dir MM + 1
OSTATS Input dir Input dir Input dir Current Current Input dir 0 Input dir VV + 1 00
RSTATS Input dir Input dir Current Current Current Input dir 0 01 00
USTATS Input dir Input dir Output dir Current Current Input dir 0 Output dir VV Output dir MM + 1
VSTATS Input dir Input dir Input dir Input dir Input dir Input dir 0 Input dir VV+1 00

...

Note

If statistics don't exist for an input member, they are created in the copied, output member.

SYSIN Parameters

If the MEMBER keyword parameter is omitted from the PARM statement, the members copied by SERCOPY must be specified in SYSIN records.

  • Member names in SYSIN records are coded in free-form format with members listed in the same record separated by spaces or comma.
  • Members may be renamed in the copy process by coding the old name and new name separated by a forward slash:

    OLDNAME/NEWNAME

  • If the MEMBER keyword parameter is omitted from the PARM statement, and no members are specified in SYSIN records, all members in the input PDS are copied to the output PDS.

Return Codes and Error Messages

This table describes return codes for SERCOPY.

Return Code Description
00-16 Same as IEBCOPY/IEBGENER
20 IEBCOPY/IEBGENER ABEND (completion code in R0)
24 Dynamic allocation error (SVC 99 error in R0) or open error on control statement data set
28 Input parameter syntax error

...

Comments

Automatic Library Reallocation

If the RETRY parameter is specified and SERCOPY encounters a space allocation problem while performing a PDS copy function (an x37 condition), it will attempt to recover by compressing the library using IEBCOPY.

If the problem persists and the REALLOC parameter is specified, SERCOPY will dynamically reallocate the target library to increase space and/or directory entries.

SERCOPY calls program SERREAL to reallocate the target data set. SERREAL determines the current size of the data set and sets new space allocations based on the following:

  • If directory blocks are insufficient, they are increased 50%, plus 8 blocks.

  • If directory blocks are not the only problem, they are increased 25%, plus 8 blocks.

  • If directory blocks are sufficient, then library space is increased on a sliding scale depending on the size of the current data set:

    • If the existing data set is small (10 tracks), space is at least doubled.

    • If the existing data set is large (400 tracks), space is increased by only 20%.

The default unit for the space allocation is blocks (BLKS).

Exit program SEREX001 can be used to override the default generic device (SYSDA) or space unit (BLKS) used by SERREAL in dynamic space reallocation.

Step and JOB Enqueue

ChangeMan ZMF batch jobs file tailored from skeletons will execute one at a time if they target the same output data set with SERCOPY. You can increase the efficiency of ChangeMan ZMF batch processing by enqueuing SERCOPY output data sets at the step level.

To protect the directory of PDS libraries targeted by SERCOPY, skeleton CMN$$ENQ is imbedded in each job step that executes SERCOPY. CMN$$ENQ catalogs a work data set with DISP=(MOD,DELETE) in DD statement SYSUT3. CMN$$ENQ uses a consistent rule to create the work data set name from the SERCOPY output data set name.

Only one job is allowed to allocate the same cataloged data set name. If more than one job targets the same library with SERCOPY, only one job will be allowed to allocate the same work data set name at a time, and all of the other jobs will be made to wait. This effectively single threads all jobs that target the same PDS with SERCOPY.

You may enqueue the SERCOPY output library at the step level by specifying the data set name in the SERCOPY PARM statement:

  1. Code the SERCOPY output DSN in the PARM statement in subparameter OUTDSN:

    //COPY1 EXEC PGM=SERCOPY,REGION=3072K,
    // PARM=’&OPT,OUTDSN(dsname)’
    

    ...

    The data set name specified in OUTDSN must already be catalogued.

  2. Delete the SYSUT2 DD statement from the SERCOPY step JCL.

  3. Remove the imbed for CMN$$ENQ from the skeleton that executes SERCOPY.

  4. Add these two ddnames to the SERCOPY step JCL:

    //SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(5,5))
    //SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(5,5))
    

    ...

PDSFAST

If you are using PDSFAST with AUTOCMPX=YES, you must remove the RETRY parameter for SERCOPY in the skeleton JCL. You can only use one or the other compression technique (that of PDSFAST or SERCOPY).

Reporting

The SYSPRINT DD statement for SERCOPY displays output from the copy utility used to copy members from the input PDS to the output PDS.