CREATE PROGRAMVIEW

Before running an application program under IMS, an application PROGRAMVIEW must be created to describe how the program can use logical terminals and logical data structures. A PROGRAMVIEW is known as a program specification block (PSB) to IMS. The CREATE PROGRAMVIEW statement creates a PSB, which is an IMS specific resource.

Invocation

This statement can be submitted from a Java™ application program with an establish connection to IMS through the IMS JDBC drivers. It is an executable statement that cannot be dynamically prepared. CREATE SENSEGVIEW and CREATE SCHEMA statements are required for the CREATE PROGRAMVIEW statement.

CREATE PROGRAMVIEW syntax

Read syntax diagramSkip visual syntax diagram CREATE PROGRAMVIEW psb_name CREATESCHEMApcb_nameA CREATESCHEMATPpcbnameB DBLEVELCURRDBLEVELBASECMPATNOCMPATYESGSROLBOKNOGSROLBOKYESOLICNOOLICYESLOCKMAXnIOASIZEnMAXQnSSASIZEnLANGASSEMLANGCOBOLLANGPLILANGPASCALLANGJAVAIOEROPNnWTORNOWTORYES

alternate_schema_statement syntax

Read syntax diagramSkip visual syntax diagram CREATE SCHEMA TP pcbname USING1lterm_nametransaction_codeASexternal_nameSAMETRMNOSAMETRMYESMODIFYNOMODIFYYESEXPRESSNOEXPRESSYESLISTYESLISTNOALTRESPNOALTRESPYES
Notes:
  • 1 The lterm_name or transaction_code is required except when MODIFYYES is specified.

DB_schema_statement syntax

Read syntax diagramSkip visual syntax diagram CREATE SCHEMA DB pcb_name USING database_name ASexternal_name ( ,ssview_statement ) PROCOPTAPROCOPTsch_procoptDBVERnCOPIESnLISTYESLISTNOPOSSNGLPOSMULTSBNOSBCONDDEDBVIEWMSDBVIEWPROCSEQff_index

GSAM_schema_statement syntax

Read syntax diagramSkip visual syntax diagram CREATE SCHEMA GSAM pcb_name USING database_name ASexternal_name PROCOPT GSLSLISTYESLISTNO

sch_procopt syntax

Read syntax diagramSkip visual syntax diagramAabGOGOPGONGONHGONPGOTGOTHGOTPLPSP
a
Read syntax diagramSkip visual syntax diagram A E P H
b
Read syntax diagramSkip visual syntax diagramGSEPHIEPHREPHDEPH

ssview_statement syntax

Read syntax diagramSkip visual syntax diagram CREATE SENSEGVIEW senseg_name (,sf_statement)WITHwith_options
with_options
Read syntax diagramSkip visual syntax diagramPROCOPTssv_procoptINDICES(,list)SSPTR(,nRU)REFERENCEStable_name

sf_statement syntax

Read syntax diagramSkip visual syntax diagram sf_name WITH START ( n)REPLYESREPLNO

ssv_procopt syntax

Read syntax diagramSkip visual syntax diagramGIEPRDAEPK

Keyword parameters for CREATE PROGRAMVIEW

The following keywords parameters can be specified in the CREATE PROGRAMVIEW statement:
psb_name
Specifies the name of the program view. A program view is equivalent to a PSB in IMS. The name must not be the same as that of a database or PSB that exists in the catalog.
DBLEVELCURR | DBLEVELBASE
When database versioning is enabled, specifies the version of the database definition that is used to return data to application programs that do not request a specific database version. For all application programs that use this program specification, the value that is specified here overrides the system default for the DBLEVEL parameter that is specified in the DFSDFxxx member of the IMS.PROCLIB data set.
DBLEVELCURR specifies that applications receive data according to the latest version of the database definition.
DBLEVELBASE specifies that applications receive data according to version 0 of the database definition.
Regardless of the default version of the database specification that is used, applications can request to use a specific version of the database specification when the program is scheduled.
CMPATNO | CMPATYES
Provides compatibility between BMP or MSG and Batch-DL/I parameter lists. If set to YES, this PSB is always treated as if there were an I/O PCB, no matter how it is used. If set to NO, the PSB has an I/O PCB added only for BMP or MSG regions. The default is NO.
GSROLBOKNO | GSROLBOKYES
Controls whether an internal ROLB call should be done to roll back non-GSAM database updates when:
  • The application is a non-message-driven BMP.
  • The PSB contains a PCB for a GSAM database.
  • Db2 for z/OS® reports a deadlock either on a thread create or on an SQL call.

YES means that the internal ROLB call is done and that the SQL code regarding the deadlock is returned to the application program. NO means that a user abend 777 occurs instead of the ROLB call. The default is NO.

OLICNO | OLICYES
Indicates whether the user of this PSB is authorized to execute the Online Database Image Copy utility or the Surveyor utility feature that runs as a BMP against a database named in this PSB. YES allows the Online Image Copy and the Surveyor utility feature; NO prohibits the Online Image Copy and the Surveyor utility feature. NO is the default. This parameter is invalid if any database PCB (a PCB with DB specified for the TYPE parameter) in the PSB specifies the L or LS processing options.
Exception: This parameter is not applicable to CICS®, GSAM, HSAM, MSDB, or DEDB databases.
LOCKMAX n
Indicates the maximum number of locks an application program can get at one time. n is a numeric value 0 - 255. n is specified in units of 1000. For example, a specification of LOCKMAX=5 indicates a maximum of 5000 locks at one time.

The default value is 0, which indicates that there is no maximum number of locks that are allowed at one time.

If an application program runs for an extended time without committing, the locking done by IMS of database records and changes can accumulate. You can use the LOCKMAX parameter to prevent a single application program from consuming all locking storage and causing other programs to abend.

You can override the LOCKMAX value that is specified at program execution by specifying LOCKMAX=0 (to turn off limit completely) or by specifying LOCKMAX=1 to 32767 on the dependent region (BMP, MPP, or IFP) or Batch (DBB or DLI). The value is in units of 1000. You can use this method to exceed the maximum value of 255 that can be specified on the LOCKMAX parameter.

IOASIZE n
Specifies the size (in bytes) of the largest I/O area used by the application program. The size specification is used to determine the amount of main storage reserved in the PSB pool to hold the control region copy of the user I/O area data during scheduling of this application program. If you do not specify this value, the IMS calculates a maximum default I/O area size. The default size is the total length of all of the sensitive segments in the longest possible path call. (The total length of the segment must be used, even if the application program is not sensitive to all fields in a segment.) The value specified is in bytes, with a maximum of 256000. However, the combined length of all concatenated segments to be returned to the application on a single path call must not exceed 65535 bytes.

If the PSB contains any field-sensitive segments, and IOASIZE is specified, the specified value is used only if it is larger than the IOASIZE calculated by the ACBGEN utility. The value of the IOASIZE that will be used is indicated. The major components of this pool requirement are IOASIZE and SSASIZE.

If STAT calls or the test program (DFSDDLT0) are used with this PSB, IOASIZE must be greater than 600 bytes.

If CMD or GCMD calls (from automated operator interface application programs) are used with this PSB, IOASIZE must be at least 132 bytes.

If extended checkpoint/restart is used, IOASIZE must be set to a value equal to or greater than the larger of the following:

  • I/O area needed to receive data from a GU call issued during restart, while repositioning DL/I databases that have a previous checkpoint (if this PSB contains any).
  • Largest LRECL used in a GSAM data set that has a previous checkpoint.

Either the value pointed to by the third parameter (I/O AREA LEN) of the XRST CALL or the value of this parameter will be used, depending on which value is larger.

MAXQ n
Is the maximum number of database calls with Qx command codes that can be issued between synchronization points. The maximum number is 32,767. The default value is zero.
SSASIZE n
Specifies the maximum total length of all SSAs used by the application program. IMS uses the size specification to determine the amount of main storage that is reserved in the PSB work pool to hold a copy of the user's SSA strings during execution of this application program. If you do not specify this value, IMS calculates a maximum SSA size to be used as a default. The size that is calculated is the maximum number of levels in any PCB within this PSB multiplied by 280. The value that is specified is in bytes, with a maximum of 256000.
Restriction: When you run IMS under CICS without DBCTL, the PSB work pool requirement cannot exceed 64 KB.

The major components of this pool requirement are IOASIZE and SSASIZE.

Important: For Fast Path secondary index calls, an SSASIZE workarea holds the converted SSAs that accommodate the additional storage from SUBSEQ fields and number of qualifications. When a DL/I call is initiated, the converted SSAs are passed into the full-function database.

The default SSASIZE is specified as the default SSA size defined during ACBGEN plus 840 bytes.

If you specify an SSASIZE or if you use the default and the SSASIZE is not large enough, an AU status code is issued. To correct this problem, specify a larger SSASIZE in the PSB and rerun PSBGEN and ACBGEN to resolve the problem.

LANGASSEM | LANGCOBOL | LANGPLI | LANGPASCAL | LANGJAVA
An optional keyword that indicates the compiler language in which the message processing or batch processing program is written. If you specify OLICYES, LANGPLI is invalid. If your application program is written in C language, specify LANGASSEM.

CICS and the Language Environment for z/OS do not support LANGPASCAL.

You must specify LANGJAVA if the application is using the Java™ class libraries for IMS in a JMP region.

If you are using IMS PL/I applications that run in a compatibility mode using the PLICALLA entry point, you must specify LANGPLI.

IOEROPN n
Is applicable only in batch-type regions (DLI or DBB). This parameter is not valid for CICS. The n subparameter is the condition code returned to the operating system when IMS terminates normally and one or more input or output errors occurred on any database during the application program execution. The n subparameter is a number from 0 to 4095.

If n=451, IMS terminates with a U451 abend instead of passing a condition code to the operating system. If n=451 and the IMS or the application program abends with an abend other than U451, and an I/O error has also occurred, a write-to-programmer of message DFS0426I is issued. This message indicates that an I/O error has occurred during execution and that a U451 abend has occurred if the actual abend has not.

If n=451, IMS terminates with abend U0451, even if the operator responds CONT to the DFS0451A message.

By using the IOEROPN parameter, you can set a unique JCL condition code when an I/O error occurs and test the condition code in subsequent job steps. If you do not specify this parameter, the return code passed from the application program is passed to the operating system and status codes and console messages are the only indications of database I/O errors.

WTORNO | WTORYES
If you specify WTORYES, a WTOR for the DFS0451A I/O error message is issued, and DL/I waits for the operator to respond before continuing. If you respond ABEND, IMS terminates with a U0451 abend. If you respond CONT IMS continues. Any other response causes the DFS0451A message to be reissued.

If you specify WTORYES or WTORNO, you must also specify IOEROPN.

Keyword parameters for CREATE SCHEMA

The following keyword parameters are defined for the CREATE SCHEMA statement:
ALTRESPNO | ALTRESPYES
Specifies whether this alternate schema can be used instead of the I/O PCB for responding to terminals in response mode, conversational mode, or exclusive mode. Valid only for alternate schemas (TP PCBs). The default is ALTRESPNO.
EXPRESSNO | EXPRESSYES
Specifies whether messages from this alternate schema are to be sent or are to be backed out if the application program should abend. Valid only for alternate schemas (TP PCBs). The default is EXPRESSNO.

EXPRESSYES, when specified indicates that messages can be sent to the destination terminal even though the program abends or issues a ROLL or ROLB call. For all PCBs (express or non-express) under these conditions, messages that are inserted but not made available for transmission are canceled, while messages made available for transmission are never canceled.

For a non-express PCB, the message is not available for transmission to its destination until the program reaches a sync (commit) point. The sync point occurs when the program terminates, issues a CHKP call, or requests the next input message (if the transaction is defined with MODE=SNGL).

For an express PCB, the message is available for transmission to the destination when IMS knows it has the complete message. The message is available when a PURG call is made using that PCB, or when the program requests the next input message.

When the PSB is defined as a Fast Path application in the IMS system definition, EXPRESSYES, if specified, is ignored at execution time for a response alternate PCB.

EXPRESSNO, when specified indicates that messages are backed out if the application program abends.

MODIFYNO | MODIFYYES
Specifies whether the alternate schema is modifiable. This feature allows for the dynamic modification of the destination name that is associated with this schema. If MODIFYYES is specified, omit the USING clause. Valid only for alternate schemas (TP PCBs). The default is MODIFYNO.
SAMETRMNO | SAMETRMYES
Specifies whether IMS verifies that the logical terminal that is named in the response alternate schema is assigned to the same physical terminal as the logical terminal that originated the input message. You must specify SAMETRMYES for response alternate schemas that are used by conversational programs and programs operating with terminals in response mode. Specify SAMETRMNO if alternate response schemas are used to send messages to output-only devices that are in exclusive mode. Valid only for alternate schemas (TP PCBs). The default is SAMETRMNO.
DBVER n
When database versioning is enabled, specifies the version number of the database definition (DBD) that this application program requires.

The numeric value specified must match a version number defined on the DBD and stored in the IMS catalog. Valid values for a database version number are 0 to 2147483647.

If multiple PCBs within a PSB refer to the same database, each PCB must specify the same DBD version number.

LISTYES | LISTNO
Specifies whether the named PCB is included in the PCB list passed to the application program at entry. Specify YES to include a named PCB in the PCB list. Specify NO to exclude a named PCB from the PCB list. YES is the default.

To exclude a PCB from the PCB list, you must assign the PCB a name with either the label or PCBNAME= parameter. You can specify LIST=NO if an application program does not need a PCB's address.

POSSNGL | POSMULT
Specifies single or multiple positioning for the logical data structure. Single or multiple positioning provides a functional variation in the call.

The performance variation between single and multiple positioning is insignificant. HSAM does not support multiple positioning.

POS=SINGLE or S is the default.

Exception: For DEDBs having more than two dependent segments, the default is POS=MULTPLE or M.

Coding a POS value on the PCB statement for a DEDB will not override the default that is selected based on the number of dependent segments.

SBNO | SBCON
Specifies which PCBs will be buffered using sequential buffering (SB). This is an optional parameter. The default is SB=NO, unless the default option has been modified for Batch and BMPs by the DFSSBUX0 to SB=COND.
COND
Specifies that SB should be activated conditionally. IMS will monitor statistics about the I/O reference pattern of this PCB to the DB data set. If IMS detects a sequential I/O reference pattern and a reasonable activity rate, it will activate SB and acquire the required buffers.
NO
Specifies that SB should not be used for this DB PCB.
Tip: For short-running MPPs, Fast Path programs, and CICS programs, either omit the SB= keyword or specify SB=NO.
DEDBVIEW | MSDBVIEW

Applications can use the default DEDB commit view, or can use either the MSDB or MSDBL commit view if you specify VIEW=MSDB or VIEW=MSDBL. If you specify VIEW=MSDBL, a lock is held for the duration of DL/I data access and then released at the end of the call.

If you choose to use the default DEDB commit view after having previously specified VIEW=MSDB or VIEW=MSDBL, no changes to existing application programs are required to migrate your MSDBs to DEDBs.

If you issue a REPL call with a PCB that specifies VIEW=MSDB or VIEW=MSDBL, the segment must have a key. This includes any segment in a path if command code 'D' is specified. Otherwise, status AM is returned.

PROCSEQ index_dbname
Specifies the name of a secondary index that is used to process the database named in the DBDNAME parameter through a secondary processing sequence. The parameter is optional. It is valid only if a secondary index exists for this database. If this parameter is used, subsequent SENSEG statements must reflect the secondary processing sequence hierarchy of segment types in the indexed database. For example, the first SENSEG statement must name the indexed segment with a PARENT=0 parameter.

full_function_index_dbname must be the name of a secondary index DBD.

For a secondary processing sequence, processing options L and LS are invalid. Inserting and deleting the index target segment and any of its inverted parents is not allowed. When the blocks are built, if the processing option for these segments includes I or D, a warning message indicates that the processing option has been changed to reflect this restriction.

PROCOPT sch_procopt
Specifies the processing options for the sensitive segments that are declared in this PCB. You can use these specified options in an associated application program. You can use a maximum of four options with this parameter. The letters in the parameter have the following meaning:
A
All options. By default, PROCOPT=A includes the G (get), I (insert), R (replace), and D (delete) options. PROCOPT=A is the default setting.
G
Get option.
I
Insert option. By default, PROCOPT=I includes the G (get) option for Fast Path DEDBs; PROCOPT=I does not include the G option for other database types.
R
Replace option. By default, PROCOPT=R includes the G (get) option.
D
Delete option. By default, PROCOPT=D includes the G (get) option.
P
Path calls. Required if command code D is to be used, except for ISRT calls in a batch program that is not sensitive to fields. PROCOPT=P is not required if command code D is used when processing DEDBs. P is used in conjunction with the A (all), G (get), I (insert), D (delete), and L (load) options.
O
If the O option is used for a PCB, IMS does not check the ownership of the segments returned. Therefore, the read without integrity program might get a segment that has been updated by another program. If the updating program abends and backs out, the read without integrity program will have a segment that does not exist in the database and never did. If a segment has been deleted and another segment of the same type has been inserted in the same location, the segment data, and all subsequent data returned to the application, can be from a different database record. Therefore, if you use the O option, do not update based on data read with that option. O must be specified as GO, GON, GONP, GOT, GOTP, or GOP only.

IMS recognizes some of these error types and converts them to abend U0849. However, other conditions that occur under PROCOPT GOx are not detected as having been caused by the read-without-integrity. It is possible to get loops, hangs, and system abends. When using this PROCOPT, carefully consider system design to determine if concurrent update activity is likely to cause higher risk of these kinds of conditions.

N
Reduces the number of abends that read-only application programs are subject to. Read-only application programs can reference data being updated by another application program. When this happens, an invalid pointer to the data might exist. If an invalid pointer is detected, the read-only application program abends. By specifying N, you avoid this. A GG status code is returned to the program instead. The program must determine whether to terminate processing, continue processing by reading a different segment, or access the data using a different path. N must be specified as GON, GONH, or GONP.
T
Similar to the N option, except that T causes DL/I to automatically retry the operation. If the retry fails, a GG status code is returned to the application program. T must be specified as GOT, GOTH, or GOTP.
E
Enables exclusive use of the database or segment by online programs. Used in conjunction with G, I, D, R, and A.
Restriction: For a DEDB, PROCOPT=E is not permitted.
L
Load option for database loading (except HIDAM and PHIDAM).
GS
Get segments in ascending sequence only (HSAM only). If you specify GS for HSAM databases, they will be read using the Queued Sequential Access Method (QSAM) instead of the basic Sequential Access Method (BSAM) in a DL/I IMS region.
LS
Load segments in ascending sequence only (HIDAM, HDAM, PHIDAM, PHDAM). This load option is required for HIDAM and PHIDAM. Because you must specify LS for HIDAM and PHIDAM databases, the index for the root segment sequence field will be created at the time the database is loaded.
H
Specifies high-speed sequential processing for the application program that is using a particular PSB. The following restrictions apply to using PROCOPT=H:
  • It can be used for DEDBs only.
  • It is allowed on the PCB level and not on the segment level.
  • It must be used with other Fast Path processing options.
  • A maximum of four PROCOPT options can be specified, including H.
  • It can only be specified for BMPs.
  • Only one PROCOPT=H PCB per database per PSB is allowed. If a BMP that is using HSSP uses multiple PCBs with PROCOPT=H for the same database within the same PSB, all database calls that are using a PCB other than the first one that is used will receive an FH status code. You can use the NOPROCH keyword on the SETO statement to alleviate this restriction.
  • PROCOPT=H cannot be used if PROCSEQD=Fast_Path_index_dbdname is specified.
  • PROCOPT=H cannot be used with PROCOPT=GO.
H is used in conjunction with A, G, I, R, and D.
The PROCOPT value can be up to 4 characters long. It needs to have at least one option from A, G, I, R, D, and L; that is, option E, S, P, O, N, T, or H cannot exist without an option from the group of A, G, I, R, D, and L group.
The default PROCOPT value is A. PROCOPT GOx and Lx groups need to follow the sequence in the diagram.

Keyword parameters for CREATE SENSEGVIEW

The following keyword parameters are defined for the CREATE SENSEGVIEW statement:
PROCOPT ssv_procopt
Indicates the processing options valid for use of this sensitive segment by an associated application program. This parameter has the same meaning as the PROCOPT= parameter on the PCB statement. In addition to the valid options for this parameter, an option can be used on the SENSEG statement which does not apply to the PCB statement. A PROCOPT of K indicates key sensitivity only. A GN call with no SSAs can access only data-sensitive segments. If a key-sensitive segment is designated for retrieval in an SSA, the segment is not moved to the user's I/O area. The key is placed at the appropriate offset in the key feedback area of the PCB. If this PROCOPT= parameter is not specified, the PCB PROCOPT parameter is used as default. If there is a difference in the processing options specified on the PCB and SENSEG statements and the options are compatible, SENSEG PROCOPT overrides the PCB PROCOPT. If PROCOPT= L or LS is specified on the preceding PCB statement, this parameter must be omitted.

Do not specify a SENSEG statement for a virtual logical child segment type if PROCOPT= L or LS is specified. The Replace and Delete functions also imply the Get function.

If a segment has PROCOPT=K specified, an unqualified Get Next call (GN) skips to the next sensitive segment with a PROCOPT other than K.

The SENSEG PROCOPT overrides the PCB PROCOPT. If PROCOPT=E is specified in the PCB, the SENSEG PROCOPT must also specify E if it is intended to schedule exclusively for that SENSEG.

It is not valid to code the N or T processing option in the SENSEG statement. You can code them only in the PCB statement.

The processing option for a DEDB sequential dependent segment must be either G or I. If one of these values is not specified on the PCB statement, PROCOPT=G or I must be specified on the SENSEG PCB statement.

In the case of concatenated segments, the PROCOPT= parameter governs the logical child segment of the concatenated segment. The logical parent of the concatenated segment is governed by the RULES= parameter of the SEGM PCB statement.

INDICES
Specifies which secondary indexes contain search fields that are used to qualify SSAs for an indexed segment type. The INDICES= parameter can be specified for indexed segment types only. It enables SSAs of calls for the indexed segment type to be qualified on the search field of the index segment type contained in each secondary index specified.
Restriction:
  • An SSA of a call for an indexed segment type cannot be qualified on the search field of a secondary index unless that secondary index was specified in the INDICES= parameter of the SENSEG statement for the indexed segment type or in the PROCSEQ= parameter of the PCB statement.
  • The INDICES= parameter is not supported for Fast Path secondary indexing.

For list1, you can specify up to 32 DBD names of secondary indexes. If two or more names are specified, these names must be separated by commas and the list enclosed in parentheses.

REFERENCES table_name
For tables that are involved in logical relationships or that are in databases that are accessed by a secondary index, use REFERENCES to identify the parent table of this table.

For tables involved in a logical relationship, the name must be the IMS internal name of the logical parent of the table.

For a table that is the physical parent of a source segment pointed to by a secondary index, use the name of the source segment.

For a table that is dependent of a source segment pointed to by a secondary index, use the name of the dependent segment's physical parent.

The REFERENCES keyword does not apply to secondary index source segments.

Schemas or PCBs that reference a physical, non-logical database and that are not in a database that has a secondary index do not support the REFERENCES keyword. If the CREATE SENSEGVIEW clause defines a root as being sensitive, omit the REFERENCES keyword.

REPLYES | REPLNO
Specifies whether or not this field can be altered on a replace call. You can specify NO or N. If omitted, REPLACE=YES (or Y) is the default.
SSPTR
Specifies the subset pointer number and the sensitivity for the pointer. Up to 8 subset pointers can be defined. The subset pointer number (the first parameter) must be 1 through 8. The sensitivity for the pointer (the second parameter) must be R (read sensitive) or U (update). If the first parameter and the second parameter are not specified, the pointer has no sensitivity. If only n is specified, the pointer is read sensitive. SSPTR=R is the default.

You cannot use U (update sensitivity) if the processing option is not A, R, I, or D.

sf_name
Is the name of this field as defined through a FIELD statement. The field is from 1- to 8-alphanumeric characters.
START(n)
Specifies the starting position of this field relative to the beginning of the segment within the user's I/O area. startpos for the first byte of a segment is 1. startpos must be a decimal number whose value does not exceed 32 767.

Types of statements

The following lists the types of schema for the CREATE PROGRAMVIEW statement:
Alternate_schema_statement
The alternate schema (PCB) describes a destination other than the source of the current input message.
This statement instruction allows the application program to send output messages to a destination other than the source of an input message.
Note: A schema statement is required for each destination to which output is to be sent.

These messages can be sent to either an output terminal or an input transaction queue to be processed by another program. Each output message destination requires a separate alternate schema (PCB) destination. If the input source terminal is all that is required to respond with output, do not include any schema statements of this type. Message processing programs, batch message processing programs, and Fast Path programs can have alternate schema statements in their associated PROGRAMVIEW. An alternate schema cannot be used to send a message to a Fast Path transaction; however, Fast Path application programs can use an alternate schema to route messages to any terminal or IMS™ transaction.

DB_schema_statement
The schema statement that describes application program access for a DL/I, Fast Path, or GSAM database.

Although one or more of these schema statements are usually included, they are not always required. For example, a message switching program or conversational message program might not require access to a database. Therefore, a database schema is not required.

The maximum number of schemas that can be defined in a PROGRAMVIEW is 2500. This is the maximum value for application programs executing in all IMS™ region types (MSG, DL/I, and so on).

Usage notes

The CREATE PROGRAMVIEW statement describes the PSB. One or more CREATE SCHEMA statements must be nested in the CREATE PROGRAMVIEW statement to describe the PCBs.

One or more CREATE SENSEGVIEW statements must be nested within each CREATE SCHEMA statement to describe the SENSEGs. SENFIELDs can be nested in each SENSEGVIEW. The order in which the SCHEMA and SENSEGVIEW statements are specified matters.

CREATE PROGRAMVIEW … (
	CREATE SCHEMA … (
		CREATE SENSEGVIEW … ,
		CREATE SENSEGVIEW … WITH …,
		CREATE SENSEGVIEW … 
	)
	CREATE SCHEMA … (
		CREATE SENSEGVIEW … (
			senfld WITH …
			senfld WITH …
			senfld WITH …
		) WITH … ,
		CREATE SENSEGVIEW … (
			senfld WITH …
			senfld WITH …
			senfld WITH …
),
		CREATE SENSEGVIEW … (
			senfld WITH …
			senfld WITH …
			senfld WITH …
		)
	)
	…
)

Examples

The following example shows a sample of a traditional IMS program specification block macro statement with multiple PCBs, followed by the equivalent DDL using the CREATE PROGRAMVIEW, CREATE SCHEMA, and CREATE VIEW statements.

PSB utility source:

*********************************************************************** 
*    DB  PCB NUMBER 1      DB   DEDBJN21                                
*********************************************************************** 
  PCB       TYPE=DB,DBDNAME=DEDBJN21,POS=M,PROCOPT=A,KEYLEN=26,        C
               PCBNAME=PCB01,EXTERNALNAME=PCB01                         
    SENSEG  NAME=HOSPITAL,PARENT=0                                      
    SENSEG  NAME=PAYMENTS,PARENT=HOSPITAL,PROCOPT=GI                    
    SENSEG  NAME=WARD,PARENT=HOSPITAL                                   
    SENSEG  NAME=PATIENT,PARENT=WARD                                    
    SENSEG  NAME=ILLNESS,PARENT=PATIENT                                 
    SENSEG  NAME=TREATMNT,PARENT=ILLNESS                                
    SENSEG  NAME=DOCTOR,PARENT=TREATMNT                                 
    SENSEG  NAME=BILLING,PARENT=PATIENT                                 
    SENSEG  NAME=ARRAY,PARENT=HOSPITAL                                  
    SENSEG  NAME=STRUCT,PARENT=HOSPITAL                                 
    SENSEG  NAME=REDEFINE,PARENT=HOSPITAL                               
    SENSEG  NAME=MAP,PARENT=HOSPITAL                                    
    SENSEG  NAME=EXFLDSEG,PARENT=HOSPITAL                               
    SENSEG  NAME=NUMSEGM,PARENT=HOSPITAL             
*********************************************************************** 
*    DB  PCB NUMBER 2      DB   DEDBJN21                                
*********************************************************************** 
  PCB       TYPE=DB,DBDNAME=DEDBJN21,POS=M,PROCOPT=GO,KEYLEN=26,       C
               PCBNAME=PCB10,EXTERNALNAME=PCB10                         
    SENSEG  NAME=HOSPITAL,PARENT=0                                      
    SENSEG  NAME=PAYMENTS,PARENT=HOSPITAL                               
    SENSEG  NAME=WARD,PARENT=HOSPITAL                                   
    SENSEG  NAME=PATIENT,PARENT=WARD                                    
    SENSEG  NAME=ILLNESS,PARENT=PATIENT                                 
    SENSEG  NAME=TREATMNT,PARENT=ILLNESS                                
    SENSEG  NAME=DOCTOR,PARENT=TREATMNT                                 
    SENSEG  NAME=BILLING,PARENT=PATIENT                                 
    SENSEG  NAME=ARRAY,PARENT=HOSPITAL                                  
    SENSEG  NAME=STRUCT,PARENT=HOSPITAL                                 
    SENSEG  NAME=REDEFINE,PARENT=HOSPITAL                               
    SENSEG  NAME=MAP,PARENT=HOSPITAL                                    
…
*********************************************************************** 
*    DB  PCB NUMBER 11          HIDAM HOSPITAL DB DH41SK01              
*********************************************************************** 
  PCB       TYPE=DB,DBDNAME=DH41SK01,POS=M,PROCOPT=AP,KEYLEN=26,       C
               PCBNAME=PCB11,EXTERNALNAME=PCB11                         
    SENSEG  NAME=HOSPITAL,PARENT=0                                      
    SENSEG  NAME=PAYMENTS,PARENT=HOSPITAL,PROCOPT=GI                    
    SENSEG  NAME=WARD,PARENT=HOSPITAL                                   
    SENSEG  NAME=PATIENT,PARENT=WARD                                    
    SENSEG  NAME=ILLNESS,PARENT=PATIENT                                 
    SENSEG  NAME=TREATMNT,PARENT=ILLNESS                                
    SENSEG  NAME=DOCTOR,PARENT=TREATMNT                                 
    SENSEG  NAME=BILLING,PARENT=PATIENT                                 
    SENSEG  NAME=PHARMACY,PARENT=HOSPITAL                               
    SENSEG  NAME=BACKORDR,PARENT=PHARMACY                               
    SENSEG  NAME=ARRAY,PARENT=HOSPITAL                                  
    SENSEG  NAME=STRUCT,PARENT=HOSPITAL                                 
    SENSEG  NAME=REDEFINE,PARENT=HOSPITAL                               
    SENSEG  NAME=MAP,PARENT=HOSPITAL                                    
    SENSEG  NAME=SFTEST,PARENT=HOSPITAL                                 
     SENFLD  NAME=SF1,START=1                                           
     SENFLD  NAME=SF2,START=40                                          
     SENFLD  NAME=SF3,START=30                                                            
*********************************************************************** 
*        PSBGEN PSBNAME=BMP255                                          
*********************************************************************** 
    PSBGEN  PSBNAME=BMP255,LANG=ASSEM,CMPAT=YES,IOASIZE=32000,         C
               SSASIZE=32000

Equivalent DDL statements:

CREATE PROGRAMVIEW bmp255 (
	CREATE SCHEMA pcb01 USING DEDBJN21(
		CREATE SENSEGVIEW hospital,
		CREATE SENSEGVIEW payments WITH PROCOPT GI,
		CREATE SENSEGVIEW ward,
		CREATE SENSEGVIEW patient, 
		CREATE SENSEGVIEW illness,
		CREATE SENSEGVIEW treatmnt,
		CREATE SENSEGVIEW doctor,
		CREATE SENSEGVIEW billing,
		CREATE SENSEGVIEW array,
		CREATE SENSEGVIEW struct,
		CREATE SENSEGVIEW redefine,
		CREATE SENSEGVIEW map,
		CREATE SENSEGVIEW exfldseg,
		CREATE SENSEGVIEW numsegm
	)
	PROCOPT A 
POS=MULTIPLE|SINGLE,

	CREATE SCHEMA pcb10 USING DEDBJN21(
		CREATE SENSEGVIEW hospital,
		CREATE SENSEGVIEW payments,
		CREATE SENSEGVIEW ward,
		CREATE SENSEGVIEW patient, 
		CREATE SENSEGVIEW illness,
		CREATE SENSEGVIEW treatmnt,
		CREATE SENSEGVIEW doctor,
		CREATE SENSEGVIEW billing,
		CREATE SENSEGVIEW array,
		CREATE SENSEGVIEW struct,
		CREATE SENSEGVIEW redefine,
		CREATE SENSEGVIEW map
	)
	PROCOPT GO
	POSMULTI,

	CREATE SCHEMA pcb11 USING DH41SK01(
		CREATE SENSEGVIEW hospital,
		CREATE SENSEGVIEW payments WITH PROCOPT GI,
		CREATE SENSEGVIEW ward,
		CREATE SENSEGVIEW patient, 
		CREATE SENSEGVIEW illness,
		CREATE SENSEGVIEW treatmnt,
		CREATE SENSEGVIEW doctor,
		CREATE SENSEGVIEW billing,
		CREATE SENSEGVIEW pharmacy,
		CREATE SENSEGVIEW backordr,
		CREATE SENSEGVIEW array,
		CREATE SENSEGVIEW struct,
		CREATE SENSEGVIEW redefine,
		CREATE SENSEGVIEW map,
		CREATE SENSEGVIEW sftest (
sf1 WITH START(1),
sf2 WITH START(40),
sf3 WITH START(30)
		)
	)
	PROCOPT AP
	POSMULTI
)
LANGASSEM
CMPATYES
IOASIZE 32000
SSASIZE 32000

TPPCBs source:

PCB    TYPE=TP,NAME=OUTPUT1
        PCB    TYPE=TP,NAME=OUTPUT2
        PCB    TYPE=DB,DBDNAME=PARTMSTR,PROCOPT=A,KEYLEN=100
        SENSEG NAME=PARTMAST,PARENT=0,PROCOPT=A
        SENSEG NAME=CPWS,PARENT=PARTMAST,PROCOPT=A
        PCB    TYPE=GSAM,DBDNAME=REPORT,PROCOPT=LS
        PSBGEN LANG=COBOL,PSBNAME=APPLPGM3
        END

Equivalent DDL statements:

CREATE PROGRAMVIEW applpgm3 (
	CREATE SCHEMA TP pcb01,
	CREATE SCHEMA TP pcb02,

	CREATE SCHEMA pcb03 USING DH41SK01(
		CREATE SENSEGVIEW partmast WITH PROCOPT ‘A’,
		CREATE SENSEGVIEW cpws WITH PROCOPT ‘A’
	)
	PROCOPT ‘A’,

	CREATE SCHEMA pcb04
	PROCOPT ‘LS’,
)
LANGCOBOL

TPPCBs source:

PCB      TYPE=DB,NAME=FISDBD1,PROCOPT=GRP,KEYLEN=20
        SENSEG   NAME=EMPLOYEE,PARENT=0
        SENFLD   NAME=EMPLNAME,START=13,REPL=NO
        SENFLD   NAME=EMPFNAME,START=1,REPL=NO
        SENFLD   NAME=EMPMI,START=11
        SENSEG   NAME=OFFICE,PARENT=EMPLOYEE
        SENSEG   NAME=EMPLPROJ,PARENT=EMPLOYEE
        SENFLD   NAME=PROJNUM,START=1
        SENFLD   NAME=PROJTITLE,START=10
        SENFLD   NAME=EPFUNCTN,START=35
        SENFLD   NAME=EPTIMEST,START=60
        SENFLD   NAME=EPTIMCUR,START =70
        PSBGEN   LANG=ASSEM,PSBNAME=APPLPGM1
        END

CREATE SENSEGVIEW APPLPGM1 (
	FISDBD1 DB FOR FISDBD1 PROCOPT ‘GRP’
	EMPLOYEE SENSEG IN FISDBD1
	EMPLNAME SENSEG IN FISDBD1 START (13) REPLACEN
	…
) LANGASSEM

CREATE PROGRAMVIEW applpgm1 (
	CREATE SCHEMA pcb01 USING FISDBD1(
		CREATE SENSEGVIEW employee (
			emplname WITH START (13) REPLNO,
			empfname WITH START (1) REPLNO,
			empmi WITH START (11)
		)

		CREATE SENSEGVIEW office,

		CREATE SENSEGVIEW emplproj (
			projnum WITH START (1),
			projtitle WITH START (10),
			epfunctn WITH START (35),
			eptimest WITH START (60),
			eptimcur with START (70)
		)
	)
)
LANGASSEM

Fast Path example:

PCB    TYPE=DB,DBDNAME=MSDBLM01,PROCOPT=R,KEYLEN=4 NONTERMINAL-RELATED  
SENSEG NAME=LDM,PARENT=0                       (DEFAULT)
PCB    TYPE=DB,DBDNAME=MSDBLM02,PROCOPT=R,KEYLEN=1 NONTERMINAL-RELATED  
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM03,PROCOPT=R,KEYLEN=2 NONTERMINAL-RELATED       
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM04,PROCOPT=R,KEYLEN=8 NONTERMINAL-RELATED 
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM05,PROCOPT=R,KEYLEN=8 FIXED RELATED 
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM06,PROCOPT=A,KEYLEN=8 DYNAMIC RELATED
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM06,PROCOPT=R,KEYLEN=8 DYNAMIC RELATED
SENSEG NAME=LDM,PARENT=0
PCB    TYPE=DB,DBDNAME=MSDBLM06,PROCOPT=G,KEYLEN=8 DYNAMIC RELATED
SENSEG NAME=LDM,PARENT=0
PSBGEN LANG=ASSEM,PSBNAME=APPLPGM1              END OF PSBGEN MACRO
END    END OF PSB GEN

CREATE PROGRAMVIEW applpgm1 (
	CREATE SCHEMA pcb01 USING MSDBLM01 (
		CREATE SENSEGVIEW lim
	)
	PROCOPT ‘R’,
	CREATE SCHEMA pcb02 USING MSDBLM02(
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘R’,
	CREATE SCHEMA pcb03 USING MSDBLM03(
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘R’,
	CREATE SCHEMA pcb04 USING MSDBLM04 (
		CREATE SENSEGVIEW lim
	)
	PROCOPT ‘R’,
	CREATE SCHEMA pcb05 USING MSDBLM05 (
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘R’,
	CREATE SCHEMA pcb06 USING MSDBLM06 (
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘A’,
	CREATE SCHEMA pcb06 USING MSDBLM06( 
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘R’,
	CREATE SCHEMA pcb06 USING MSDBLM06 
		CREATE SENSEGVIEW lim
	) 
	PROCOPT ‘G’
)
LANGASSEM

TPPCBs source:

DEDB SSPTR
PCB    TYPE=DB,DBDNAME=MSDBLM01,PROCOPT=R,     NONTERMINAL-RELATED     X
PCB TYPE=DB,DBDNAME=X,PROCOPT=A,KEYLEN=100
SENSEG NAME=A,PARENT=0
SENSEG NAME=B,PARENT=A,SSPTR=((1,R),(2,U),(5))
SENSEG NAME=C,PARENT=B
SENSEG NAME=D,PARENT=A,SSPTR=((2,R))
PSBGEN LANG=COBOL,PSBNAME=APPLPGM1
END

CREATE PROGRAMVIEW applpgm1 (
	CREATE SCHEMA pcb01.msdblm01 AS pcb01 
	PROCOPT ‘R’,

	CREATE SCHEMA pcb02.x AS pcb02 (
		CREATE SENSEGVIEW a, 

		CREATE SENSEGVIEW b
		WITH SSPTR (1 R,2 U,5),

		CREATE SENSEGVIEW c.b,

		CREATE SENSEGVIEW d.a
		SSPTR (2 R)
	)
	PROCOPT ‘A’
)
LANGCOBOL

TPPCBs source:

PCB        TYPE=DB,DBDNAME=DTA3,PROCOPT=A,KEYLEN=15,PROCSEQ=X4
SENSEG     NAME=DA,PARENT=0
SENSEG     NAME=DB,PARENT=DA
SENSEG     NAME=DC,PARENT=DA,INDICES=X5
SENSEG     NAME=DD,PARENT=DC
SENSEG     NAME=DE,PARENT=DC,INDICES=X6
PSBGEN     LANG=COBOL,PSBNAME=APPLPGM1
END


CREATE PROGRAMVIEW applpgm1 (
	CREATE SCHEMA pcb01.dta3 AS pcb01 (
		CREATE SENSEGVIEW da,

		CREATE SENSEGVIEW db.da,

		CREATE SENSEGVIEW dc.da WITH INDICES (X5)

		CREATE SENSEGVIEW dd.dc

		CREATE SENSEGVIEW de.dc WITH INDICES (X6)
	)
	PROCOPT ‘A’ 
	PROCSEQ X4
)
LANGCOBOL