Information
Space announcement: BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.

USER (US)


The USER function is a form of COPY that creates new records or data sets. USER allows greater control when writing output records and data sets. USER can perform three tasks:

  • Insert new records at any point in a data set
  • Repeat records with changed data
  • Write multiple output datasets from a single input dataset.

New records are built by copying the input record, or by moving data to the output record with the MOVE parameter. File-AID automatically copies the input record to the output when executing a USER function, except when a MOVE parameter is used. With the MOVE parameter, File-AID initializes the output area to binary zeros, and assumes that the parameter statements build the entire record. (Use the PADCHAR parameter to override the default initialization value of binary zero.) If a location has no data moved to it, binary zeros remain. The output area is not reinitialized between writes.

The USER function always processes all parameter groups for each input record, as if the ALL modifier had been specified. Thus, USERALL is not valid.


Warning

Important

  • An installation default forces the USER function to close all of its output datasets after each use. This allows the output from a USER function to be used as input to another function in the same job step. For more information, see Installing on changing this default.

  • For the USER function, the input and output files cannot be the same file unless it is sequential and has fixed length records. For DDxxO, using the same dataset name is permitted if it is a different physical data set on a different volume. File-AID issues the message: THE INPUT DATASET CANNOT ALSO BE THE OUTPUT DATASET.
  • The USER function is not supported for PDS or PDSE load libraries.
  • If you intend to write the USER function output to tape, read Example 35 and Example 36.

Example 1:

$$DD01 USER WRITE=OUTPUT

Example 1 copies the input dataset and writes it to the data set defined with a DD name of OUTPUT.

Example 2:

$$DD01 USER SELECT=10,IF=(40,NE,C’X,Y,Z’),WRITE=EXTRACT,OUT=25

Example 2 creates an extract file with the DD name of EXTRACT. This data set contains every tenth record on the input data set that contains a value not equal to the characters X,Y, or Z in location 40. A maximum of 25 records are written to the output extract file.

Example 3:

$$DD01 USER WRITE=A,IF=(1,0,C’CANCEL’),WRITE=A

Example 3 repeats a record. The first WRITE parameter writes all input records to the output dataset with the DD name of A. The IF parameter selects any input record that contains the string CANCEL. The second WRITE parameter writes the record a second time.

Example 4:

$$DD01 USER WRITE=NEWDSN,IF=(21,EQ,P’5’),MOVE=(1,0,1),
            MOVE=(21,P’155’),WRITE=NEWDSN

Example 4 repeats a record with changed data. The first WRITE parameter reads in a record and writes it out. The IF parameter checks to see if the record contains a packed decimal value of 5 beginning in location 21. The first MOVE parameter copies the input record to the output area. The second MOVE parameter moves the two-byte packed decimal value 155 to location 21. The second WRITE parameter then writes the newly built record to the output dataset with the DD name of NEWDSN.

Example 5:

$$DD01 USER F=JCL,WRITE=NEWJCL,IF=(1,20,C’EXEC’),
            MOVE=(1,80C’ ’),MOVE=(1,C’//SYSUDUMP DD SYSOUT=A’),
            WRITE=NEWJCL

Example 5 builds and inserts new records at specific locations in an output dataset as it is copied from the input dataset. The IF, MOVE, and WRITE parameters are used to insert a SYSUDUMP DD statement after each EXEC statement in a JCL job stream.

The F(FORM) parameter tells File-AID to expect JCL data. The first WRITE parameter copies a complete JCL statement from the input dataset to the output dataset. The IF parameter locates any JCL statement that contains a character string EXEC in the first 20 locations of the statement. When an EXEC is found, the first MOVE parameter places 80 blanks in the output area. The second MOVE parameter loads the required data into the record. The second WRITE parameter writes the newly built record to the data set with the DD name of NEWJCL.


Warning

Important

FORM=JCL is not valid with all syntax forms of the MOVE parameter. For more information, see MOVE-MV.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Compuware File-AID/MVS 21.01