Hold Spooled File (HLDSPLF)
The Hold Spooled File (HLDSPLF) command stops the specified spooled file from additional processing by a spooled writer. If the file is being produced on an output device, the writer stops processing that file and gets the next file to be processed. When the file is released and selected for output, it is again processed starting at the beginning of the file. If multiple copies are being produced for the file when it is held, the incomplete copy is produced from the beginning again and any remaining copies follow it.
Keyword |
Description |
Choices |
Notes |
FILE |
Spooled file |
Name, *SELECT |
Required, Positional 1 |
JOB |
Job name |
Single values: * Other values: Qualified job name |
Optional, Positional 2 |
Qualifier 1: Job name |
Name |
Qualifier 2: User |
Name |
Qualifier 3: Number |
000000-999999 |
SPLNBR |
Spooled file number |
1-999999, *ONLY, *LAST, *ANY |
Optional, Positional 3 |
JOBSYSNAME |
Job system name |
Name, *ONLY, *CURRENT, *ANY |
Optional |
CRTDATE |
Spooled file created |
Single values: *ONLY, *LAST Other values: Element list |
Optional |
Element 1: Creation date |
Date |
Element 2: Creation time |
Time, *ONLY, *LAST |
SELECT |
Select files for |
Element list |
Optional |
Element 1: User |
Name, *CURRENT, *ALL |
Element 2: Print device |
Name, *ALL, *OUTQ |
Element 3: Form type |
Character value, *ALL, *STD |
Element 4: User data |
Character value, *ALL |
Element 5: ASP |
1-32, *ALL, *ASPDEV |
ASPDEV |
ASP device |
Name, *, *SYSBAS, *CURASPGRP |
Optional |
OPTION |
When to hold file |
*IMMED, *PAGEEND |
Optional |
Spooled file (FILE)
Specifies the spooled file to hold.
This is a required parameter.
- *SELECT
- All spooled files that meet the selection values specified on the Select files for (SELECT) parameter are held. This value is mutually exclusive with values specified on the Job name (JOB) parameter, Spooled file number (SPLNBR) parameter, Job system name (JOBSYSNAME) parameter, and Spooled file created (CRTDATE) parameter.
- name
- Specify the name of the spooled file to hold.
Job name (JOB)
Specifies the job that created the file being held.
Single values
- *
- The job that issued this Hold Spooled File (HLDSPLF) command is the job that produced this file.
Qualifier 1: Job name
- name
- Specify the name of the job that created the file being held.
Qualifier 2: User
- name
- Specify the user name that identifies the user profile under which the job is run.
Qualifier 3: Number
- 000000-999999
- Specify the system-assigned job number.
Spooled file number (SPLNBR)
Specifies the number of the spooled file that was created by the specified job.
- *ONLY
- Only one spooled file in the job has the specified file name; therefore, the number of the spooled file is not necessary.
- *LAST
- The spooled file with the highest number and the specified file name is used.
- *ANY
- The spooled file number is not used to determine which spooled file is used. Use this value when the job system name parameter or the spooled file create date and time parameter is to take precedence over the spooled file number when selecting a spooled file.
- 1-999999
- Specify the number of the spooled file having the specified file name that is being held.
Job system name (JOBSYSNAME)
Specifies the name of the system where the job that created the spooled file (JOB parameter) ran. This parameter is considered after the job name, user name, job number, spooled file name, and spooled file number parameter requirements have been met.
- *ONLY
- There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and spooled file create date and time.
- *CURRENT
- The spooled file created on the current system with the specified job name, user name, job number, spooled file name, spooled file number, and create date and time is used.
- *ANY
- The job system name is not used to determine which spooled file is used. Use this value when the spooled file create date and time parameter is to take precedence over the job system name when selecting a spooled file.
- name
- Specify the name of the system where the job that created the spooled file ran.
Spooled file created (CRTDATE)
Specifies the date and time the spooled file was created. This parameter is considered after the job name, user name, job number, spooled file name, spooled file number, and job system name parameter requirements have been met.
Single values
- *ONLY
- There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and job system name.
- *LAST
- The spooled file with the latest create date and time of the specified job name, user name, job number, spooled file name, spooled file number, and job system name is used.
Element 1: Creation date
- date
- Specify the date the spooled file was created.
Element 2: Creation time
- *ONLY
- There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file create date.
- *LAST
- The spooled file with the latest create time of the specified job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file create date is used.
- time
- Specify the time the spooled file was created.
Select files for (SELECT)
Specifies which group of files are to be held. Positional values can be specified to select the files: the user that created the file, the device that the file is queued for, the form type specified, the user data tag associated with the file, or the auxiliary storage pool the file is in. Only files that meet each of the values are selected.
Element 1: User
- *CURRENT
- Only files created by the user running this command are selected.
- *ALL
- Files created by all users are selected.
- name
- Specify a user name. Only files created by that user name are selected.
Element 2: Print device
- *ALL
- Files on any device-created or user-created output queue are selected.
- *OUTQ
- All files on any user-created output queue are selected. A user-created output queue is any output queue that is not automatically created by a device. A user-created output queue does not generally have the same name as a device, but if it does, it does not reside in library QUSRSYS.
- name
- Specify a device name. Only files on the device created output queue for that device are selected. A device created output queue is one that has the same name as a device and resides in the QUSRSYS library. Unless it already exists, it will automatically be created by the system when the device is created. A device created output queue cannot be deleted.
Element 3: Form type
- *ALL
- Files for all form types are selected.
- *STD
- Only files that specify the standard form type are selected.
- form-type
- Specify the form type to select the file.
Element 4: User data
- *ALL
- Files with any user data tag specified are selected.
- user-data
- Specify the user data tag to select the file.
Element 5: ASP
- *ALL
- All files as specified in the Auxiliary Storage Pool Device (ASPDEV) parameter are selected.
- *ASPDEV
- Files specified in the Auxiliary Storage Pool Device (ASPDEV) parameter are selected.
- 1-32
- Specify the auxiliary storage pool (ASP) of the files being selected.
ASP device (ASPDEV)
Specifies the auxiliary storage pool device name from which spooled files are to be selected. This parameter is only valid if the ASP number (ASP) element of the Select parameter is *ALL or *ASPDEV.
- *
- Files which are found in the ASPs that are currently part of the thread's library name space are selected. This includes the system ASP (ASP 1), all defined basic user ASPs (ASPs 2-32), and if the thread has an ASP group, the primary and secondary ASPs in the thread's ASP group.
- *SYSBAS
- Files which are found in the system ASP (ASP 1) and all defined basic user ASPs (ASPs 2-32) are selected.
- *CURASPGRP
- Files which are found in the primary and secondary ASPs in the thread's ASP group are selected. If no ASP group is associated with the thread, an error will be issued.
- name
- Specify the name of the auxiliary storage pool device description. Files which are found in the specified primary or secondary ASP are selected. Only primary or secondary ASPs which are in the thread's ASP group may be specified. If no ASP group is associated with the thread, an error will be issued.
When to hold file (OPTION)
Specifies which option to use when holding the spooled file.
Note: Specifying an option when the file is not being written has no effect.
- *IMMED
- The file is to be held as soon as possible.
- *PAGEEND
- The file is to be held on a page boundary.
Example 1: Holding a File Created by Another Job
HLDSPLF FILE(SHIPITEMS) JOB(00009/JONES/ORDER)
This command withholds the spooled file SHIPITEMS, created by the job ORDER, from additional processing.
Example 2: Holding a File at a Page Boundary
HLDSPLF FILE(QPJOBLOG) OPTION(*PAGEEND)
This command holds the spooled file QPJOBLOG at a page boundary.
Example 3: Holding a File Immediately
HLDSPLF FILE(QPJOBLOG) OPTION(*IMMED)
This command holds the spooled file QPJOBLOG immediately. Holding a spooled file by specifying this option causes the CHGSPLFA command RESTART(*NEXT) to be inaccurate if the spooled file is currently being processed by a spool writer.
*ESCAPE Messages
- CPF337E
- ASP device &1 not in current ASP group for thread.
- CPF337F
- ASP device &1 not allowed with ASP number &2.
- CPF33D0
- Printer &1 does not exist.
- CPF33D1
- User &1 does not exist.
- CPF3303
- File &1 not found in job &5/&4/&3.
- CPF3309
- No files named &1 are active.
- CPF3330
- Necessary resource not available.
- CPF3337
- File &1 number &8 already held or saved.
- CPF3340
- More than one file with specified name found in job &5/&4/&3.
- CPF3342
- Job &5/&4/&3 not found.
- CPF3343
- Duplicate job names found.
- CPF3344
- File &1 number &8 no longer in the system.
- CPF3357
- Output queue &1 in library &2 not found.
- CPF34A4
- File &1 number &8 not held or deleted.
- CPF3492
- Not authorized to spooled file.
- CPF9825
- Not authorized to device &1.
- CPF9833
- *CURASPGRP or *ASPGRPPRI specified and thread has no ASP group.
- CPFB8ED
- Device description &1 not correct for operation.