ID Parameters:

Category:

Program Painter and Specification Editor keyword (see Keywords:)

Compatibility:

IDMS DB target

Description:

Code native IDMS calls in the Data and Environment Divisions and pass them through, without translation, to the precompile process.

Syntax:

Data Division:

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 IDCS   IDMSControlSectionstatements
      .
      .
      .

Environment Division:

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 IDSS   SchemaSectionstatements
      .
      .
Comments:


IDM-COMMIT

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Write a COMT checkpoint to the IDMS journal file to designate the start or end of specific database accessing activities associated with the issuing run unit and release all record locks except select locks held on current records.

Syntax:
IDM-COMMIT [ALL]
Parameter:

ALL

Release all record locks and set all currencies to null.

Example:

Write a COMT checkpoint to the IDMS journal file; release all record locks held on current records; set all currencies to null.

IDM-COMMIT ALL

IDM-CONNECT

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Connect the named record to the named set.

Syntax:
IDM-CONNECT REC [recordname] TO setname
Parameters:

TO setname

Connect record to specified IDMS set name.

REC [recordname]

Retrieve specified record. Define recordname as a member of the set and current of its record type. Put any area(s) that the set uses in an update mode.

Comments:

Example

Connect record type ORDER to CUSTOMER-ORDER. Note that owner record is current of record type.

MOVE SCR-ORDER-NUM TO ORDERNUM
MOVE SCR-QTY-ORD   TO ORDER-QTY
DB-STORE REC ORDER
IF OK-ON-REC
    MOVE SCR-ORDER-NUM TO ORDER-NUM
    MOVE SCR-QTY-ORD TO ORDER-QTY
    DB-OBTAIN REC CUSTOMER WHERE CUST-NUMBER = WS-CUST-KEY
    IF OK-ON-REC
        IDM-CONNECT REC ORDER TO CUSTOMER-ORDER
        IF AB-ON-REC
            PERFORM 950-ERROR-RTN

IDM-DISCONNECT

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Disconnect the record from the set in which it participates as an optional member.

Syntax:
IDM-DISCONNECT REC [recordname] FROM setname
Parameters:

FROM setname

Disconnect record from specified IDMS set name.

REC [recordname]

Retrieve specified record. Define recordname as a member of the set and current of its record type. Put any area(s) that the set uses in an update mode.

Comment:

Recordname is optional because the record is previously located by a DB-OBTAIN REF.

Example:

Disconnect record type ORDER from CUSTOMER-ORDER.

DB-OBTAIN REF CUSTOMER REC ORDER
IF OK-ON-REC
    IDM-DISCONNECT REC ORDER FROM CUSTOMER-ORDER
    IF AB-ON-REC
        PERFORM 950-ERROR-RTN

IDM-IF

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Determine if a data set is empty or if a record is a member of a given set; perform logic if condition is met.

Syntax:
IDM-IF SET setname [EMPTY|NOT EMPTY]
... [MEMBER|NOT MEMBER] paragraphname
Parameters:

[NOT] EMPTY

Specify if there are member records for setname.

[NOT] MEMBER

Specify if the record, that is current of RUN-UNIT, is a member of setname.

paragraphname

Perform paragraphname when IF condition is met.

SET setname

Specify IDMS set name.

Examples:
IDM-IF SET DEPT-EMPLOYEE MEMBER 2000-GET-OWNER
IDM-IF SET DEPT-EMPLOYEE NOT MEMBER
... 2100-NO-OWNER
IDM-IF SET DEPT-EMPLOYEE NOT EMPTY
... 3100-GET-EMPS

IDM-PROTOCOL

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Specify the program execution mode and the location of IDMS record descriptions.

Syntax:
-KYWD-  12--*--20---*----30----*---40---*----50---*----60
 SYEN   IDM-PROTOCOL programmode location
Parameters:

programmode

Execution mode. Refer to the IDMS COBOL Programmer's Guide for valid program modes.

location

Place IDMS record descriptions copied from the IDMS Dictionary in this program area. Valid values are:

L-S or LS

Linkage Section

W-S or WS

Working-Storage

MANUAL

Generate an IDMS-Records Manual statement within Working-Storage; generate COPY and BIND statements for records referenced within the program.

Comments:

Example:

Set the protocol for an IDMS CICS program; place IDMS record descriptions in Working-Storage.

IDM-PROTOCOL CICS-EXEC-AUTO W-S

IDM-RETURN

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Return the database key and symbolic key (optional) from an indexed set via a currency or key value.

Syntax:
IDM-RETURN dataname FROM indexsetname
... [CURRENCY [FIRST|LAST|NEXT|PRIOR]]
... [USING keyfield]
... [KEY INTO keyfield]
Parameters:

CURRENCY

Retrieve database key based on currency within the indexed set. If CURRENCY or USING is not coded, default is CURRENCY.

dataname

Return the database key into the named Working-Storage field. Define as PIC S9(08) COMP SYNC.

KEY INTO keyfield

Return the symbolic key obtained from the indexed set into Working-Storage keyfield. Currency specification is optional.

USING keyfield

Use the value of keyfield to sea"rch the index and return the database key. See also "Comments:" below. If USING is not coded, default is CURRENCY.

Examples
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
... CURRENCY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
... FIRST CURRENCY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
... USING WS-EMP-KEY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
... FIRST CURRENCY KEY INTO WS-EMP-KEY

IDM-ROLLBACK

Category:

Database call (see Database Calls)

Compatibility:

IDMS DB target

Description:

Write an ABRT checkpoint to the IDMS journal file to recover the recovery unit (the part of the run unit falling between two checkpoints); allow the run unit to continue accessing the database without issuing the DB-BIND and DB-OPEN calls.

Syntax:
IDM-ROLLBACK [CONTINUE]
Parameter:

CONTINUE

Specify recovery unit is to roll back.

Comments:


IDMS

Category:

IDMS statement

Compatibility:

IDMS DB target

Description:

Code native IDMS calls in the Procedure Division and pass them through, without translation, to the precompile process.

Syntax:
-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 IDCS   IDMS nativecall
                      .
                      .
Comments:

Example:
-KYWD-  12--*--20---*----30----*---40---*----50---*----60
        IDMS OBTAIN FIRST CUST-REC
        ... WITHIN CUST-REGION

Generated rule:

$IDMS ("OBTAIN FIRST CUST-REC",
% ... "WITHIN CUST-REGION")

IDMS DB Sample Programs

Compatibility:

IDMS DB target

Batch Program:
-LINE-  -KYWD- 12--*--20---*----30----*---40---*----50---*---60
000100   SYM1  % SET NOBLANK
000200         &07*NO-ACTIVITY-LOG
000300         &07*DMLIST
000800   PROC
001000         DB-OPEN MODE UPDATE
001100         DB-OBTAIN REC CUSTOMER FIRST AREA CUSTOMER-REGION
001300         IF OK-ON-REC                /* APS IDMS 1.7 FLAG
001400            DISPLAY 'FIRST CUSTOMER IS ' CUST-NAME
001500            REPEAT
001600                DB-OBTAIN REC CUSTOMER 
001601                ... NEXT AREA CUSTOMER-REGION
001700            UNTIL NOT OK-ON-REC
001701                DISPLAY 'NEXT CUSTOMER IS ' CUST-NAME
001710            IF END-ON-REC
001720                DISPLAY 'END OF AREA SWEEP'
001730            ELSE-IF VIO-ON-REC
001740                DISPLAY 'IDMS RULE VIOLATION ' ERROR-STATUS
001750            ELSE
001760                DISPLAY 'CATCH-ALL ERROR ' ERROR-STATUS
001770        ELSE-IF POS-ON-REC
001780            DISPLAY 'CANNOT POSITION WITHIN CUST AREA '
001781            ... ERROR-STATUS
001790        ELSE-IF VIO-ON-REC
001791            DISPLAY 'IDMS RULE VIOLATION OCCURRED '
001792            ... ERROR-STATUS
001793        ELSE
001794            DISPLAY 'CATCH-ALL ERROR ' ERROR-STATUS
001800        DB-CLOSE

Program with Generated Code:

Program Painter code:

-KYWD-  12--*---20---*----30----*---40---*---50---*---60---*
 IDCS
        PROTOCOL.    MODE IS BATCH DEBUG
                     IDMS-RECORDS IN WORKING-STORAGE SECTION
 IDSS   DB SAMPSS WITHIN SAMPSCH.
 OPT    PROG
 NTRY
 PARA   MAIN-PARA.
        COPY IDMS SUBSCHEMA-BINDS
        IDMS READY USAGE-MODEL IS RETRIEVAL
        TP-PERFORM IDMS-STATUS
        TP-PERFORM PROCESS-CUSTOMERS
        IDMS FINISH
 PARA   PROCESS-CUSTOMERS.
        IDMS OBTAIN FIRST CUST-REC WITHIN CUST-REGION
        IF ERROR-STATUS GREATER THAN '0000'
            TP-PERFORM ABORT-PARA
        ELSE
            TP-PERFORM DISPLAY-CUSTOMER
        REPEAT
            IDMS OBTAIN NEXT CUST-REC WITHIN CUST-REGION
        UNTIL ERROR-STATUS GREATER THAN '0000'
            TP-PERFORM DISPLAY-CUSTOMER
        IF ERROR-STATUS = '0307'
            DISPLAY '***** END OF CUST-REGION *****'
        ELSE
            PERFORM ABORT-PARA
 PARA   DISPLAY-PARA.
        DISPLAY SPACE
        DISPLAY 'CUST-REC = ' CUST-REC
 PARA   ABORT-PARA.
        DISPLAY SPACE
        DISPLAY '***** READ FAILURE *****'
        DISPLAY 'ERROR-STATUS = ' ERROR-STATUS
        IDMS FINISH
        STOP RUN

Generated S-COBOL program:

%   &AP-GEN-VER = 1719
%   &AP-PGM-ID = "TSTIDMS"
%   &AP-GEN-DB-TARGET = "VSAM"
%   &AP-TP-ENTRY-KYWD-SEEN = 1
%   &AP-SUBSCHEMA = ""
%   &AP-APPLICATION-ID = "TSTIDMS"
%   &AP-GEN-DATE = "870105"
%   &AP-GEN-TIME = "15482536"
IDENTIFICATION DIVISION.
PROGRAM-ID.                     TSTIDMS.
AUTHOR.                         AP-SYSTEM GENERATED.
DATE-WRITTEN.                   870105.
DATE-COMPILED.                  &COMPILETIME.
ENVIRONMENT DIVISION.
IDMS-CONTROL SECTION.
PROTOCOL.    MODE IS BATCH DEBUG
             IDMS-RECORDS WITHIN WORKING-STORAGE SECTION.
CONFIGURATION SECTION.
SOURCE-COMPUTER.                &SYSTEM.
OBJECT-COMPUTER.                &SYSTEM.
DATA DIVISION.
SCHEMA SECTION.
DB SAMPSS WITHIN SAMPSCH.
WORKING-STORAGE SECTION.
$TP-WS-MARKER
$TP-COMMAREA
$TP-ENTRY ("", "")
MAIN-PARA.
    COPY IDMS SUBSCHEMA-BINDS
    $IDMS ("READY USAGE-MODEL IS RETRIEVAL")
    $TP-PERFORM ("IDMS-STATUS")
    $TP-PERFORM ("PROCESS-CUSTOMERS")
    $IDMS ("FINISH")
PROCESS-CUSTOMERS.
    $IDMS ("OBTAIN FIRST CUST-REC",
    % ... "WITHIN CUST-REGION")
    IF ERROR-STATUS GREATER THAN '0000'
        $TP-PERFORM ("ABORT-PARA")
    ELSE
        $TP-PERFORM ("DISPLAY-CUSTOMER")
    REPEAT
        $IDMS ("OBTAIN NEXT CUST-REC WITHIN CUST-REGION")
    UNTIL ERROR-STATUS GREATER THAN '0000'
        $TP-PERFORM ("DISPLAY-CUSTOMER")
    IF ERROR-STATUS = '0307'
        DISPLAY '***** END OF CUST-REGION *****'
    ELSE
        PERFORM ABORT-PARA
DISPLAY-PARA.
    DISPLAY SPACE
    DISPLAY 'CUST-REC = ' CUST-REC
ABORT-PARA.
    DISPLAY SPACE
    DISPLAY '***** READ FAILURE *****'
    DISPLAY 'ERROR-STATUS = ' ERROR-STATUS
    $IDMS ("FINISH")
    STOP RUN

IDMS Options

Compatability:

IDMS DB target

Category:

Application generation

Description:

Define processing environment for application and program generation.

Procedure:

  1. From the APS Options Menu enter option 7 in the Option field. Alternatively, from any APS screen enter opt 7 in the Command or Option field. The IDMS Options screen displays.

  2. Specify IDMS options appropriate for your environment.

    Option
    Description and Values

    Dictionary Name

    Specify the dictionary name.

    Central Version or Local

    Specify the compile environment. APS generates a SYSTRNL with a unique DSN whose high level qualifier is your user ID.

    cv

    Default. Central Version.

    local

    When you specify local, also enter a volume in the IDMS Local Jrnl Disk Vol field.

    dummy

    When you specify dummy, APS generates a SYSTRNL DD DUMMY

    IDMS Local Jrnl Disk Vol

    Local compile disk volume for journal.

    Dictionary Update

    Yes

    Log program compile information to the dictionary.

    No

    Default. Do not log program compile information.

    IDMS DMLC Output to PDS

    Yes

    Write DMLC compile statements to a PDS. If you enter yes, you must allocate a &DSN..IDMSOUT PDS prior to compilation.

    No

    Default. Do not write DMLC compile statements to a PDS.

    IDMS Loadlib Qualifier

    Specify full qualifiers for IDMS..LOADLIB.

    IDMS SYSCTL DSN

    Optional. Specify DSN of IDMS dictionary.

    CV Node Name

    Name of central version DDS (Distributed Database System) node under which loadlib program compiles.

    DMLIST (List Generation)

    Yes

    Generate list.

    No

    Default.

    Generate DB-BIND in Pgm

    Yes

    Generate the DB-BIND macro.

    No

    Suppress the generation of the DB-BIND macro. Code the DB-BIND macro in your program.

    IDMS Password

    N/A


IF/ELSE-IF/ELSE

Category:

S-COBOL structure (see S-COBOL Structures)

Description:

Evaluate a condition.

Syntax:

Format 1:

IF condition1
  statementblock
[ELSE-IF|ELSE IF condition2
  statementblock
              .
              .
              .
 ELSE-IF|ELSE IF conditionN
  statementblock ]
[ELSE
  statementblock ]

Format 2:

COBOLimperativestatement
... COBOLconditionalclause
  statementblock
ELSE-IF|ELSE IF condition1
  statementblock
[             .
              .
              .
ELSE-IF|ELSE IF conditionN
  statementblock ]
[ELSE
  statementblock ]
Logic Execution:

Comments:

Examples:

If line 2020 is false, pass control back to line 1020, the first statement after the PERFORM statement, because there is no ELSE-IF or ELSE coding associated with this IF, and the first character at the same or less indentation as this IF is a new paragraph name, which denotes the end of the preceding PERFORMed paragraph. If the line 2020 condition is true, execute its subordinate statement block (lines 2030 through 2170) and return control to line 1020.

After line 2030 is executed, test line 2040. If the condition in line 2040 is true, execute lines 2050 through 2071; pass control to line 2170. If line 2040 is false, test line 2080, etc. If lines 2040, 2080, and 2120 are false, execute the ELSE statement block (line 2160) and pass control to line 2170.

 -LINE- -KYWD-  12-*----20---*----30---*----40---*----50----
 001010         PERFORM EMPLOYEE-BENEFIT-DEDUCTION
 001020             MOVE ...
                      .
                      .
                      .
 002010  PARA   EMPLOYEE-BENEFIT-DEDUCTION
 002020         IF EMPL-COVERAGE NOT = SPACES
 002030             PERFORM CALC-BASIC-BEN
 002040             IF EMPL-COVERAGE-TYPE = 'EXTRA'
 002050                 PERFORM CALC-EXTRA-BEN
 002060                 PERFORM CALC-DENTAL-BEN
 002070                 BEN-FIELD = XTRA-BEN + 
 002071                 ... DENTAL-BEN
 002080             ELSE-IF EMPL-COVERAGE-TYPE = 
 002081             ... 'FAMILY'
 002090                 PERFORM CALC-FAMILY-BEN
 002100                 PERFORM CALC-DENTAL-BEN
 002110                 BEN-FIELD = FAMILY-BEN + 
 002111                 ... DENTAL-BEN
 002120             ELSE-IF EMPL-COVERAGE-TYPE = 
 002121             ... 'DENTAL'
 002130                 PERFORM CALC-DENTAL-BEN
 002140                 BEN-FIELD = BASIC-BEN + 
 002141                 ... DENTAL-BEN
 002150             ELSE
 002160                 BEN-FIELD = BASIC-BEN
 002170             EMPL-DED-FIELD =
 002171             ... BEN-FIELD * .5 / 12
 002180
 002190     PARA  CALC-BASIC-BEN

Nest conditional statements.

IF condition1
  statementblock1
    IF condition2
        IF condition3
  statementblock2
        ELSE-IF condition4
        ELSE-IF condition5
  statementblock3
        ELSE
  statementblock4
    ELSE
  statementblock5
        IF condition6
            IF condition7
  statementblock6
 
  statementblock7

Make the MULTIPLY function conditional by ON SIZE ERROR.

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
            WS-NET-PAY = EMP-HOURS *
            ... EMP-HOURLY-RATE
            ... ON SIZE ERROR
                PERFORM PRINT-ERROR-MESSAGE
                DISPLAY SSNO WS-NET-PAY
                WS-NET-PAY  WS-DEDUC = 0
            ELSE-IF EMP-HOURLY-RATE =
            ... MIN-WAGE
                PERFORM CALC-DEDUC-MIN
            ELSE-IF EMP-HOURLY-RATE < 5.00
                PERFORM CALC-DEDUC-1
            ELSE-IF EMP-HOURLY-RATE >= 5.00
                PERFORM CALC-DEDUC-2
                IF EMP-HOURLY-RATE > 20.00
                    DISPLAY SSNO 
                    ... EMP-HOURLY-RATE
            ELSE
                DISPLAY SSNO  EMP-HOURLY-RATE
                PERFORM PRINT-ERROR-MESSAGE
            NET-PAY = WS-NET-PAY - WS-DEDUC

Using a NEXT SENTENCE construction, the following S-COBOL code:

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 PARA   CALC-BENEFIT
            BEN-FIELD = ZERO
            IF PERM-PART-TIME
                PERFORM GROUP-A-CALC
                IF HRS-WORKED > 25
                    BEN-FIELD = 
                    ... BEN-FIELD * 1.25
            ELSE-IF PART-TIME
            ELSE-IF FULL-TIME
                PERFORM GROUP-B-CALC
            EMPL-REC-BEN-FIELD = 
            ... BEN-FIELD

Replaces the following COBOL code.

CALC-BENEFIT.
    MOVE ZERO TO BEN-FIELD.
    IF PERM-PART-TIME
        PERFORM GROUP-A-CALC
        IF HRS-WORKED > 25
            MULTIPLY BEN-FIELD BY 1.25
        ELSE
            NEXT SENTENCE
    ELSE
        IF PART-TIME
            NEXT SENTENCE
        ELSE
            IF FULL-TIME
                PERFORM GROUP-B-CALC
            ELSE
                NEXT SENTENCE.
    MOVE BEN-FIELD TO EMPL-REC-BEN-FIELD.

$IM- Data Communication Calls

Category:

IMS Fast Path DC call (see Data Communication Calls)

Compatibility:

IMS DC target for single-platform applications

Description:

Perform Fast Path data communication calls.

Syntax:
$IM-CHNG altview [destination]
$IM-CMD [PCBname] [msgarea]
$IM-GCMD [PCBname] [msgarea]
$IM-GN PCBname SSA1 [... SSA15]
$IM-GU PCBname SSA1 [... SSA15]
$IM-ISRT [PCBname]altview] SSA1 [... SSA15]
$IM-PURG [PCBname] [msgarea] [mod]
Parameters:

altview

Alternate view or IO PCB name.

destination

Terminal destination; can be data name or literal in an 8-byte field.

msgarea

Area where IMS returns the message segment being processed; APSAPS treats this area as the first segment of a new message.

mod

Data name or literal in an 8-byte field naming the message output description.

pcbname

Database view (maximum 20 characters); default is IO-PCB.

SSA

Segment Search Argument, which triggers COBOL MOVEs to or from the generated I/O area IM-IO-AREA; default is IM-IO-AREA with a length of 32,000 bytes. To override the length, set IM-IO-AREA-LEN in your program or the DDISYMB member.

Specify only one SSA per hierarchical level along a path. These arguments generate 8-byte records in Working-Storage to hold the corresponding values.

Examples:

The following code:

$IM-CHNG ("ALT-IO", "YOUR-TERMINAL-NAME")

Generates in Working-Storage:

01  IM-DESTINATION-NAME    PIC X(8).

Generates in the Procedure Division:

MOVE YOUR-TERMINAL-NAME
... TO IM-DESTINATION-NAME
CALL 'CBLTDLI' USING
... IM-CHNG ALT-IO-PCB
... IM-DESTINATION-NAME
MOVE ALT-IO-STATUS
... TO IM-STATUS

The following code:

$IM-CHNG ("AOT-IO", "'YOURTERM'")

Generates in Working-Storage:

01  IM-DESTINATION-NAME    PIC X(8).

Generates in the Procedure Division:

 MOVE 'YOURTERM'
 ... TO IM-DESTINATION-NAME
 CALL 'CBLTDLI' USING
 ... IM-CHNG ALT-IO-PCB
 ... IM-DESTINATION-NAME
 MOVE ALT-IO-STATUS
 ... TO IM-STATUS

$IM-FLD

Category:

IMS Fast Path database call (see Database Calls)

Compatibility:

IMS DB target

Description:

Access Main Storage Data Bases (only) at the field level, and query the field contents and subsequently change the field value.

Syntax:
$IM-FLD MSDBview fsaname [rootssa]
Parameters:

fsaname

COBOL dataname for the generated field search argument. See also $IM-FSA.

MSDBview

Main Storage Data Base PCB.

rootssa

Root segment search argument; if not specified, APS retrieves the first segment in the MSDB.

Comment:

Refer to your IMS documentation for more information on $IM-FLD.


$IM-FSA

Category:

IMS Fast Path database call (see Database Calls)

Compatibility:

IMS DB target

Description:

Build your own field search argument (FSA) to use with the IM-FLD call.

Syntax:
$IM-FSA fsaname segment
... [field1[/picture/] operator operand1
... [field2[/picture/] operator operand2]
                .
                .
                .
 ... [field10[/picture/[ operator operand10]
Parameters:

field

Segment field name; can be 8-character IMS field name or the corresponding COBOL record name.

fsaname

COBOL data name for the generated FSA; references the FSA in $IM-FLD.

operand

Value to test against field in a field verify, or actual field value in a field change.

operator

Valid operators for a field verify are:

E

Verify that field and operand are equal.

G

Verify that field is greater than operand.

H

Verify that field is greater than or equal to operand.

L

Verify that field is less than operand.

M

Verify that field is less than or equal to operand.

N

Verify that field is not equal to operand.

 

Valid operators for a field change are:

+

Add operand from field.

-

Subtract operand from field.

+

Set field to value of operand

picture

COBOL picture; if not specified, APS calculates picture from field length and field type.

segment

The segment referenced by the FSA; can be eight-character IMS segment name or the corresponding COBOL field name.

Comment:

Refer to your IMS documentation for more information on $IM-FSA.


$IM-POS

Category:

IMS Fast Path database call (see Database Calls)

Compatibility:

IMS DB target

Description:

Access Data Entry Data Bases (DEDBs) only. Retrieve the location of a specific sequential dependent segment or the last inserted sequential dependent segment, or determine the amount of unused space within each DEDB area.

Syntax:
$IM-POS DEDBview [SSA]
Parameters:

DEDBview

Data Entry Data Base PCB

SSA

Segment Search Argument, which triggers COBOL MOVEs to or from the generated I/O area IM-IO-AREA; default is IM-IO-AREA with a length of 32,000 bytes. To override the length, set IM-IO-AREA-LEN in your program or DDISYMB member.

Specify only one SSA per hierarchical level along a path. These arguments generate 8-byte records in Working Storage to hold the corresponding values.

Comments:


% INCLUDE

Category:

APS Customizer statement (see your Customization Facility User's Guide)

Description:

Open, read, and process a user-defined rule, copybook, or other file in an APS program.

Syntax:
% INCLUDE ddname(filename)
Parameters:

ddname (filename)

Ddname and file to include

Comments:

Examples:

Include a rule at the top of the program.

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 SYM1   % INCLUDE USERMACS(MY-RULE)

Include a rule at the bottom of the program.

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 SYBT   % INCLUDE USERMACS(MY-RULE)

Include a copybook in Working-Storage.

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 SYWS   % INCLUDE COPYLIB(MY-COPYBOOK)

Include a copybook in Linkage.

-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 SYLK   % INCLUDE COPYLIB(MY-COPYBOOK)

INITIATE

Category:

Report Writer statement (see Report Writer Structures and the APS User's Guide chapter Creating Reports with Report Writer.)

Compatibility:

Batch environments

Description:

Initialize all report counters and accumulators; set up control heading and control footing items.

Syntax:
INITIATE reportname1 [,reportname2] ...
Comments:


IO

Category:

Program Painter and Specification Editor keyword (see Keywords:)

Compatibility:

Batch environments

Description:

Generate the Input-Output Section File-Control paragraph.

Syntax:
-KYWD-  12-*----20---*----30---*----40---*----50---*----60
 IO     filename ASSIGN [TO] systemname
        Applicable COBOL FILE-CONTROL clauses
Comments:


ISPF Dialog Compatibility: with IMS DC, CICS

Compatibility:

ISPF Dialog target

Description

The following calls improve communication between APS/ISPF Dialog and other DC targets.

NTRY

You can list explicit data areas; this allows flexibility in passing data areas between programs.

TP-COMMAREA

Not required to pass data areas between programs, but is supported for upward compatibility.

SEND

Provided for upward compatibility; does not invoke a program. Use LINK to invoke a program that displays a screen.

TP-LINKAGE

Provided for upward compatibility. This call is necessary for APS/CICS to order the LINKAGE section properly, but APS/ISPF Dialog lets you locate user records in LINKAGE without coding TP-LINKAGE.

The PFKEY option allows PF key processing similar to APS/CICS and APS/IMS with the Program-Controlled option when converting an APS/CICS or APS/IMS application to ISPF Dialog.

Screens being converted from APS/CICS or APS/IMS must have a command field, at least 4-bytes long, for users to enter ISPF commands and to allow PF key processing to function. The command field must be. Otherwise, data truncation errors result.

Do not use the APS Prototype Execution facility to execute your ISPF Dialog programs; execute them using the Dialog Test facility provided by ISPF.


Job Control Cards

Category:

Application generation

Description:

Create job cards to submit application/program generation batch jobs.

Procedure:

To create up to five job cards--named J1 through J5-- with varying job names, account information, classes, and other attributes, follow these steps.

  1. Access the Job Control Cards screen. To do so, from the APS Options Menu enter option 6 in the Option field. Alternatively, from any APS screen enter opt 6 in the Command or Option field. The Job Control Cards screen displays.

  2. Modify the cards as desired.


Joins

Category:

Database access clauses

Compatibility:

SQL target

Description:

In the same call, select rows or specific columns from more than one table in the same call. Join tables together by using the DB-DECLARE, DB-OBTAIN, and DB-PROCESS calls.

Syntax:

With DB-DECLARE:

DB-DECLARE cursorname correlname1.copylibname-REC
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
           .
           .
           .
... correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
           .
           .
           .
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
           .
           .
           .
... AND|OR correlname.columnN operator [:]value|correlnameN]]
... [ORDER
... column1 [ASC|DESC] [...columnN [ASC]]]

With DB-OBTAIN:

DB-OBTAIN REC correlname1.copylibname-REC
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
           .
           .
           .
... REC correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
           .
           .
           .
... AND|OR correlname.columnN oper [:]val|correlname.columnN]]

With DB-PROCESS:

DB-PROCESS REC correlname1.copylibname-REC
... [DB-PROCESS-ID name]
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
           .
           .
           .
... REC correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
           .
           .
... AND|OR correlname.columnN oper [:]val|correlname.columnN]]
... [DB-LOOP-MAX=number]
... [ORDER 
... column1 [ASC|DESC] [...columnN [ASC|DESC]]]
 Controlled logic block
Parameters:

See the applicable database call for keyword descriptions.

Comments:

Examples:

Select specific columns from tables D2MASTER and D2INVTRY; add qualifications to the WHERE clause. Note that every column in the WHERE clause is preceded by a correlation name.

DB-OBTAIN REC A.D2TAB-REC
... PM_PART_NO PM_UNITS PM_COLOR
... REC B.D2INVEN-REC
... IN_PART_NO IN_QTY_ONHAND IN_DATE_LAST_ORDER
... WHERE A.PM_PART_NO = B.IN_PART_NO
... AND A.PM_COLOR = 'RED'
... AND B.IN_COLOR = 'RED'

Declare the cursor D2JOIN-CUR and include columns from tables D2MASTER and D2INVTRY. Use a WHERE clause to select rows where

Eliminate duplicate rows from the cursor set (rows with matching data in every selected column are considered duplicates). Sort the cursor set in ascending order by PM_PART_NO from table D2MASTER, then in descending order by IN_QTY_ONHAND from table D2INVTRY.

DB-DECLARE D2JOIN-CUR A.D2TAB-REC DISTINCT
... PM_PART_NO PM_COLOR B.D2INVEN-REC
... IN_PART_NO IN_QTY_ONHAND
... WHERE A.PM_PART_NO = B.IN_PART_NO AND B.IN_QTY_ONHAND > 100
... ORDER A.PM_PART_NO B.IN_QTY_ONHAND DESC

Process the cursor D2MAST-ID. The cursor set includes columns from tables D2MASTER and D2INVTRY. Use a WHERE clause to include rows in the cursor set where:

Eliminate duplicate rows from the cursor set (rows with matching data in columns PM_PART_NO, PM_COLOR, IN_PART_NO, and IN_COLOR are considered duplicates). Sort cursor set in ascending order by D2MASTER columns PM_PART_NO and PM_COLOR.

DB-PROCESS REC A.D2TAB-REC
... DB-PROCESS-ID D2MAST-ID
... DISTINCT
... PM_PART_NO PM_COLOR
... REC B.D2INVEN-REC 
... IN_PART_NO IN_COLOR
... WHERE A.PM_PART_NO = B.IN_PART_NO
... AND A.PM_PART_SHORT_DESC =
... :WS-PART-SHORT-DESC 
... AND B.IN_QTY_ONHAND > 100 
... DB-LOOP-MAX=999
... ORDER A.PM_PART_NO ASC
... A.PM_COLOR ASC

Join a table to itself. Retrieve records where the IN_QTY_ONHAND column is greater than 100 and retrieve records whose IN_DATA_LAST_ORDER column matches these records.

DB-PROCESS REC A.D2INVEN-REC
... DB-PROCESS-ID D2MAST-ID
... IN_PART_NO
....IN_QTY_ONHAND
... IN_DATE_LAST_ORDER
... REC B.D2INVEN-REC
... IN_PART_NO       (:WS-PART-NO)
... IN_QTY_ONHAND    (:WS-QTY-ONHAND)
... WHERE A.IN_DATA_LAST_ORDER = B.IN_DATE_LAST_ORDER
... AND A.IN_QTY_ONHAND > 100

Keywords

Description:

Program Painter/Specification Editor keywords designate program Divisions and Sections. The keyword you choose determines the location of your program code within the generated program.

Program Painter keywords also designate blocks of code within which all other categories of APS structures are coded. Following any keyword, you can enter

Code keywords in the Program Painter for batch, report, or complex online programs, or in Online Express.

Keywords:

The following lists the keywords and their logical placement in a program.

Location
Keyword
Definition

Beginning of program

SYM1, see SY* Keywords

Define rule variables.

 

SYM2, see SY* Keywords

Call user-defined rules after any rule libraries named in Application View.

IDENTIFICATION DIVISION

REM

Create COBOL comments in the Comments: Section. Not valid for COBOL/2.

ENVIRONMENT DIVISION

SPNM

Create Special-Names paragraph

 

SYEN , see SY* Keywords

Call user-defined rules in Special-Names paragraph.

Input/Output Section

SYIO, see SY* Keywords

Call user-defined rules after any rule libraries.

 

IO

Code SELECT statement.

DATA DIVISION

SYDD, see SY* Keywords

Call user-defined rules at the beginning of the Data Division.

File Section

SYFD, seeSY* Keywords

Call user-defined rules after any rule libraries included.

 

FD
or
SD

Code File Description or Sort Description statement.

Record description

01

Code record description in COBOL format.

 

DS

Specify name of data structure defined in Data Structure Painter containing record description.

 

REC

Specify name of data structure defined in Data Structure Painter containing record description. Structure must be coded in Data Structure Painter format (see Data Structures).

 

++, see Joins

Specify PANVALET member name containing record description.

WORKING-STORAGE

SYWS, see SY* Keywords

Call user-defined rules after any rule libraries and data structures named in Application View.

 

WS

Designate Working-Storage section.

Data definitions

01

Code data structure in COBOL format.

 

DS

Specify name of data structure defined in Data Structure Painter containing data definition.

 

REC

Specify name of data structure defined in Data Structure Painter containing data definition. Structure must be coded in Data Structure Painter format (see Data Structures).

 

++ Joins

Specify PANVALET member name containing data definition.

 

SQL

Designate DB2 table or cursor.

 

CA

Redefine the TP-USERAREA of the COMMAREA in CICS, IMS, and DLG parent programs.

LINKAGE SECTION

SYLT, see SY* Keywords

Call user-defined rules after any rule libraries and data structures named in the Application View and preceding any SYLK code.

 

SYLK, see SY* Keywords

Call user-defined rules after any rule libraries and data structures named in the Application View.

 

LK

Designate Linkage Section.

Data definitions

01

Code data structure in COBOL format.

 

DS

Specify name of data structure defined in Data Structure Painter containing data definition.

 

REC

Specify name of data structure defined in Data Structure Painter containing data definition. Structure must be coded in Data Structure Painter format (see Data Structures).

 

++, see Joins

Specify PANVALET member name containing data definition.

 

SQL

Designate DB2 table or cursor.

 

CA

Redefine the TP-USERAREA of the COMMAREA in CICS, IMS, and DLG parent programs.

Report Section

SYRP, see SY* Keywords

Call user-defined rules after any rule libraries.

 

RED

Create a Report Section and specify the report name.

 

MOCK

Identify the report mock-up.

 

01

Specify the type of report line, such as header, footer, detail.

PROCEDURE DIVISION

NTRY
or
PROC

Designate the Procedure Division; generate program skeleton and program invocation logic.

 

OPT

Suppress generation of program invocation logic.

 

PARA and Paragraphs

Designate S-COBOL or COBOL paragraph.

 

STUB

Name the global code to be inserted.

Declaratives Section

DECL

Create a Declarative Section without paragraphs; code declarative statements.

 

DPAR

Create a Declarative Section paragraph; code declarative paragraph statements.

Bottom of program

SYBT, see SY* Keywords

Call user-defined rules.

Anywhere in the program

/*, see Comments

Code comments. The /* keyword does not end the action of the current keyword; the next keyword ends the current one.

 

FRFM

Pass associated COBOL or S-COBOL statements through the generator without translation and move the statements four columns to the left.

Syntax: Rules

Pass-Through Parameters:

The following keywords provide pass-through support by letting you code native calls and pass them through, without translation, to the precompile process.

IDCS and IDSS, see IDMS

Code and pass through native IDMS DB calls.

SQL

Code and pass through native SQL calls.

CICS

Code and pass through native CICS calls.

Example:

The following examples include all APS keywords that you can enter in the Program Painter when creating online or batch programs. They illustrate

Online programs:

*SYM1 keyword places Customizer code here
*user rules from Appl View where Location=Top of program
*SYM2 keyword places Customizer code here
 IDENTIFICATION DIVISION.  
          .
          .
          .
*/* keyword places comments here (COBOL/2)
 REMARKS.  REM keyword places comments here (COBOL)
 ENVIRONMENT DIVISION.  
          .
          .
          .
 SPECIAL-NAMES.  SPNM keyword places code here
*SYEN keyword places Customizer code here
 DATA DIVISION.  
*SYDD keyword places Customizer code here
 WORKING-STORAGE SECTION.  
*user rules from Appl View where Location=Top of W-S
*data structures from from Appl View where Location=Top of W-S
*user rules from Appl View where Location=Working-Storage
*SYWS keyword places Customizer code here
*WS  keyword, followed by any of the following six 
*    keywords that you enter on the next line
*01   keyword
*REC  keyword
*DS   keyword
*SQL  keyword
*++   keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of W-S
*CA, CA05, CADS keywords place code here in CICS, DDS, IMS, 
*    DLG parent pgms
 LINKAGE SECTION.  
*user rules from Appl View where Location=Top of Linkage
*data structures from Appl View where Location=Linkage Section
*user rules from Appl View where Location=Linkage Section
*SYLT keyword places Customizer code here
*SYLK keyword places Customizer code here
*LK  keyword, followed by any of the following six 
*    keywords that you enter on the next line
*01   keyword
*DS   keyword
*REC  keyword
*SQL  keyword
*++   keyword
*FRFM keyword
*CA, CA05, CADS keywords place code here in DLG child programs
*user rules from Appl View where Location=Bottom of Linkage
 PROCEDURE DIVISON.  NTRY|PROC keyword generates this stmt
*OPT keyword places code here
          .
          .
          .
*PARA keyword places code here
          .
          .
          .
*STUB keyword places code here
          .
          .
          .
*user rules from Appl View where Location=Bottom of program
*SYBT keyword places Customizer code here
*End of program.  
 

Batch programs:

*SYM1 keyword places Customizer code here
*user rules from Appl View where Location=Top of program
*SYM2 keyword places Customizer code here
 IDENTIFICATION DIVISION.  
          .
          .
          .
*/* keyword places comments here (COBOL/2)
 REMARKS.  REM keyword places comments here (COBOL)
 ENVIRONMENT DIVISION.  
          .
          .
          .
 SPECIAL-NAMES.  SPNM keyword places code here
*SYEN keyword places Customizer code here
 INPUT-OUTPUT SECTION.  
*user rules from Appl View where Location=Top of I/O Section 
*SYIO keyword places Customizer code here
 FILE-CONTROL.  
*IO   keyword places code here
          .
          .
          .
 DATA DIVISION.  
*SYDD keyword places Customizer code here
 FILE SECTION.  
*user rules from Appl View where Location=Top of File Section
*FD keyword places code here
*SD keyword places code here
 WORKING-STORAGE SECTION.  
*user rules from Appl View where Location=Top of W-S
*data structures from from Appl View where Location=Top of W-S
*user rules from Appl View where Location=Working-Storage
*SYWS keyword places Customizer code here
*WS  keyword, followed by any of the following six 
*    keywords that you enter on the next line
*01   keyword
*REC  keyword
*DS   keyword
*SQL  keyword
*++   keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of W-S
 LINKAGE SECTION.  
*user rules from Appl View where Location=Top of Linkage
*data structures from Appl View where Location=Linkage Section
*user rules from Appl View where Location=Linkage Section
*SYLT keyword places Customizer code here
*SYLK keyword places Customizer code here
*LK  keyword, followed by any of the following six 
*    keywords that you enter on the next line
*01   keyword
*DS   keyword
*REC  keyword
*SQL  keyword
*++   keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of Linkage
 PROCEDURE DIVISON.       /*NTRY keyword generates this stmt
 PROCEDURE DIVISON USING. /*PROC keyword generates this stmt
 DECLARATIVES.          /* DECL keyword generates this stmt
 DECLARATIVES SECTION.  /* DPAR generates this stmt
*DPAR keyword places code here
 END DECLARATIVES.
*OPT keyword places code here
          .
          .
          .
*PARA keyword places code here
          .
          .
          .
*STUB keyword places code here
          .
          .
          .
*user rules from Appl View where Location=Bottom of program
*SYBT keyword places Customizer code here
*End of program. 

Copyright © 2002 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.