# jCL PQ-SELECT

Updated: 10/19/2020, 10:24:56 AM
Created: 10/19/2020, 10:24:56 AM
Last Updated By: Daniel Klein
Read Time: 1 minute(s)

# Description

This command when executed from a jCL program, loads a list of keys into a select register. It takes the general form:

PQ-SELECT  register-number
1

Where register-number is the number of the select register (1 to 5) in which the keys are to be placed.

# Note

To use PQ-SELECT, a list must first be constructed using one of the list processing commands such as SELECT, SSELECT , QSELECT, BSELECT, GET-LIST, FORM-LIST, SEARCH or ESEARCH.
Put the PQ-SELECT command in the stack so that it will be processed as part of the external job stream when the required list is active.

Retrieve the list elements one at a time, using a "!n" direct or an indirect reference.

PQ-SELECT  cannot be executed directly from the shell.

# Example

001 PQN
002 HSSELECT SALES
003 STON
004 HPQ-SELECT  1
005 P
006 10 MV %1 !1
007 IF # %1 X Done
008 T %1
009 GO  10
1
2
3
4
5
6
7
8
9

This example selects all the records in the SALES file, loads the record-list into select register 1 and displays the keys one at a time.

Back to jCL.