| Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Merge Spooled Files (MRGSPLFOND) command combines multiple SNA character stream (SCS) spooled files and writes the result to a single spooled file or database file member. Spooled files to be merged must be contained in a single output queue and must be in ready (RDY) status. Spooled files that are not in a Ready (RDY) status and that are not SCS will be left in the source output queue.
The first spooled file that is processed is used to define the attributes of the merged spooled file. All subsequent spooled files to be merged must have identical attributes. After each spooled file is merged successfully, it can be deleted or moved to another output queue where it can be optionally placed on hold. The resulting merged spooled file or database file member can also be automatically archived into a specified Application Group and Application within an OnDemand Common Server instance, after merge processing has completed.
Note: When processing begins, spooled files are selected to be merged. Spooled files which are added to the source output queue after the selection process completes will not be merged.
Spooled files that do not have identical attributes to the first spooled file processed will not be processed. A message can be written to the joblog for each spooled file that is not processed. The message will indicate that, due to the attribute difference listed in the message, the spooled file could not be merged. Spooled files that are not processed will be left in the source output queue in RDY status.
Restrictions:
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| FROMOUTQ | From output queue | Qualified object name | Required, Positional 1 |
| Qualifier 1: From output queue | Name | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| OUTPUT | Output | *TOFILE, *TOOUTQ | Optional |
| TOOUTQ | To output queue | Qualified object name | Optional |
| Qualifier 1: To output queue | Name | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| TOFILE | To file | Qualified object name | Optional |
| Qualifier 1: To file | Name | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| TOMBR | To member | Name, *FIRST | Optional |
| MBROPT | Replace or add records | *REPLACE, *ADD | Optional |
| DLTPRCSPLF | Delete processed spooled files | *NO, *YES | Optional |
| PRCOUTQ | Processed files output queue | Qualified object name | Optional |
| Qualifier 1: Processed files output queue | Name | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| HLDPRCSPLF | Hold processed spooled files | *NO, *YES | Optional |
| SPLF | Spooled file | Name, *ALL | Optional |
| FORMTYPE | Form type | Character value, *ALL, *STD | Optional |
| USRDTA | User data | Character value, *ALL, *NONE | Optional |
| JOB | Job name | Single values: * Other values: Qualified job name |
Optional |
| Qualifier 1: Job name | Name, *ALL | ||
| Qualifier 2: User | Name, *ALL | ||
| Qualifier 3: Number | 000000-999999, *ALL | ||
| USRDFNOPT | User defined option | Single values: *ALL, *NONE Other values (up to 4 repetitions): Character value |
Optional |
| USRDFNDTA | User defined data | Character value, *ALL, *NONE | Optional |
| NBRFILES | Maximum spooled files to merge | Integer, *NOMAX | Optional |
| ARCHIVE | Archive merged file | *NO, *YES | Optional |
| APPGRP | Application group | Character value | Optional |
| APP | Application | Character value | Optional |
| INSTANCE | Instance | Character value, *DFT | Optional |
| DLTINPUT | Delete input | *NO, *YES | Optional |
| IDXONLY | Run indexing only | *NO, *YES | Optional |
| ERROPT | Error option | *RMVRPT, *NORMVRPT | Optional |
| STRSVR | Start instance server | *NO, *YES | Optional |
| SBMJOB | Submit to batch | *YES, *NO | Optional |
| JOBD | Job description | Qualified object name | Optional |
| Qualifier 1: Job description | Name, QOND400 | ||
| Qualifier 2: Library | Name, QRDARS, *LIBL, *CURLIB | ||
| NOTPRCMSG | Not processed file messages | *NONE, *INFO | Optional |
| Top |
Specifies the name of output queue containing the spooled files to be merged.
This is a required parameter.
Qualifier 1: From output queue
Qualifier 2: Library
| Top |
Specifies whether the output created after merging the specified SCS spooled files is a spooled file or database file.
| Top |
Specifies the output queue where the resulting merged spooled file will be placed. The spooled file name of the merged files will be the same as the first spooled file processed that matches the selection criteria specified.
This is a required parameter, if OUTPUT(*TOOUTQ) is specified.
Qualifier 1: To output queue
Qualifier 2: Library
| Top |
Specifies the database file name and member where the resulting merged file will be placed. If the file does not exist, it will be automatically created. If the default library value of *LIBL is specified, and the file does not already exist, it will not be created automatically.
This is a required parameter, if OUTPUT(*TOFILE) is specified.
Qualifier 1: To file
Qualifier 2: Library
| Top |
Specifies the name of the file member that receives the merged records.
| Top |
Specifies whether the first input spooled file replaces or is appended to the end of the existing records in the merged output file member. Each subsequent input spooled file will be appended to the end of the previous records in the output file member. If the output file or member does not exist, it will be automatically created. If the TOFILE default library value of *LIBL is specified, and the file does not already exist, it will not be created automatically.
| Top |
Specifies whether or not to delete a spooled file that MRGSPLFOND processes successfully. If MRGSPLFOND is unsuccessful, the spooled file is not deleted.
Note: Delete processed spooled files (DLTPRCSPLF) *YES can not be specified with Run indexing only (IDXONLY) *YES.
| Top |
Specifies the output queue where successfully processed spooled files will be moved.
This is a required parameter, if Delete processed spooled files (DLTPRCSPLF) is *NO.
Qualifier 1: Move processed files to outq
Qualifier 2: Library
| Top |
Specifies whether or not to hold successfully processed spooled files after they are moved to the processed output queue.
| Top |
Specifies the name of the spooled files that are selected to be merged.
| Top |
Specifies the type of form of the spooled files that are to be merged.
| Top |
Specifies user-specified data that identifies the files to be merged.
| Top |
Specifies the job that created the spooled files to be merged.
Single values
Qualifier 1: Job name
Qualifier 2: User
Qualifier 3: Number
| Top |
Specifies one or more user-defined options to be used to select the spooled files to be merged. A maximum of four user-defined options can be specified.
The user-defined option must be blank for files to be selected to be merged.
| Top |
Specifies user-defined data to be used to select the spooled files to be merged.
Note: If you specify to archive the merged spooled file using the Add Report to OnDemand (ADDRPTOND) command, only the first 60 characters of the user defined data will be used when Application group APPGRP(*USRDFNDTA) or Application APP(*USRDFNDTA) is specified.
| Top |
Specifies the maximum number of spooled files to be merged.
| Top |
Specifies whether or not to archive the merged output file using the Add Report to OnDemand (ADDRPTOND) command.
When the MRGSPLFOND command is run with OUTPUT(*TOFILE) and ARCHIVE(*YES), after all the spooled files are copied into the To file (TOFILE), the Add Report to OnDemand (ADDRPTOND) command is executed with INPUT(*FILE).
When the MRGSPLFOND command is run with OUTPUT(*TOOUTQ) and ARCHIVE(*YES), the spooled files are copied into a temporary physical file, that physical file is copied to a spooled file in the To output queue (TOOUTQ), and the Add Report to OnDemand (ADDRPTOND) command is executed with INPUT(*SPLF).
| Top |
Specifies the name of the application group to be used with the Add Report to OnDemand (ADDRPTOND) command.
This is a required parameter, if Archive merged file (ARCHIVE) is *YES.
Note: Position the cursor in the application group parameter entry and use the prompt (F4) key to view the list of application group values that are available for the default (*DFT) instance.
The default instance is specified in the QDFTINST data area. The QDFTINST data area can exist in multiple libraries. A search for the QDFTINST data area is performed using the library list. The first data area found will be used. If the QDFTINST data area is not found using the library list, the QUSRRDARS library will be searched for the data area. If the data area exists in the QUSRRDARS library it will be used. If the QDFTINST data area is not found, instance QUSROND is used.
| Top |
Specifies the name of the application to be used with the Add Report to OnDemand (ADDRPTOND) command.
Note: Position the cursor in the application parameter entry and use the prompt (F4) key to view the list of application values that are available for the default (*DFT) instance.
The default instance is specified in the QDFTINST data area. The QDFTINST data area can exist in multiple libraries. A search for the QDFTINST data area is performed using the library list. The first data area found will be used. If the QDFTINST data area is not found using the library list, the QUSRRDARS library will be searched for the data area. If the data area exists in the QUSRRDARS library it will be used. If the QDFTINST data area is not found, instance QUSROND is used.
| Top |
Specifies the name of the instance to use.
Specifies the name of the OnDemand instance to use.
| Top |
Specifies whether the input data is deleted after the data is successfully loaded by the Add Report to OnDemand (ADDRPTOND) command. An unsuccessful Add Report to OnDemand (ADDRPTOND) command does NOT delete the input.
| Top |
Specifies whether to run only the indexing part of the Add Report to OnDemand (ADDRPTOND) command.
Note: Run indexing only (IDXONLY) *YES can not be specified with Delete processed spooled files (DLTPRCSPLF) *YES.
| Top |
Specifies what to do if the Add Report to OnDemand (ADDRPTOND) command is not successful.
| Top |
Specify to start the instance server if it is not currently active.
| Top |
Specify if you want to perform merge processing in a separate batch job.
| Top |
Specifies the name of the job description used for the submitted job.
Qualifier 1: Job description
Qualifier 2: Library
| Top |
Specifies whether informational messages should be written to the job log for spooled files that are selected but could not be processed because of a spooled file attribute mismatch.
| Top |
Example 1: Merge and Archive All Reports with Form Type *STD
MRGSPLFOND FROMOUTQ(QPRINT) OUTPUT(*TOFILE)
TOFILE(QGPL/MERGEDRPT) PRCOUTQ(QGPL/PRT01)
FORMTYPE(*STD) ARCHIVE(*YES) APPGRP(*USERDATA)
SBMJOB(*YES)
This command merges all reports in the QPRINT output queue with form type *STD and places the merged output in a file called MERGEDRPT in library QGPL. After each spooled file is successfully merged it is moved to output queue PRT01 in library QGPL.
After the merge processing has been completed, the merged output is archived using the Add Report to OnDemand (ADDRPTOND) command. The Application Group name is obtained from the user data found in the first spooled file that is merged.
All merge and archive processing will run in a separate batch job.
Example 2: Merge up to 500 Checks
MRGSPLFOND FROMOUTQ(PAYABLES) OUTPUT(*TOFILE)
TOFILE(QGPL/CHECKS) MBROPT(*ADD)
PRCOUTQ(QGPL/APCHECKS) HLDPRCSPLF(*YES)
SPLF(CHKSPRTF) USRDTA(PAYABLES) JOB(CHECKS)
NBRFILES(500) ARCHIVE(*NO) SBMJOB(*YES)
This command merges spooled files from the PAYABLES output queue that have been printed with the CHKSPRTF printer file, have user data of PAYABLES and were created by a job called CHECKS. All successfully merged spooled files will be appended to the first database file member of the CHECKS file in library QGPL. Only the first 500 spooled files with matching selection criteria will be merged. All successfully merged spooled files will be moved to the APCHECKS output queue in library QGPL and placed on hold.
All merge processing will be run in a separate batch job.
Example 3: Merge and Archive All Reports with Form Type *STD to an Output Queue
MRGSPLFOND FROMOUTQ(QPRINT) OUTPUT(*TOOUTQ)
TOOUTQ(QGPL/ACCOUNTING) PRCOUTQ(QGPL/PRT01)
FORMTYPE(*STD) ARCHIVE(*YES) APPGRP(*USERDATA)
SBMJOB(*YES)
This command merges all reports in the QPRINT output queue with form type *STD and places the merged output in an output queue named ACCOUNTING in library QGPL. After each spooled file is successfully merged it is moved to output queue PRT01 in library QGPL.
After the merge processing has been completed, the merged output is archived using the Add Report to OnDemand (ADDRPTOND) command. The Application Group name is obtained from the user data found in the first spooled file that is merged.
All merge and archive processing will run in a separate batch job.
| Top |
*ESCAPE Messages
| Top |