|
|
The IVP can be run in two separate ways:
As an alternative to the IVP, you could run the sample control region definition program,DEFCICSRGN
The IVP comprises the following steps:
In generating the BMS and COBOL objects, you will use the supplied CL commands CRTCICSMAP (to create the symbolic and physical BMS maps) and CRTCICSCBL (to translate and compile COBOL source code containing CICS API into OS/400 program objects).
Step 1. Creating a working copy of QCICSSAMP
Before generating the BMS and COBOL objects, you should make a security copy of the QCICSSAMP library to CICSWORK by issuing the following command:
CPYLIB FROMLIB(QCICSSAMP) TOLIB(CICSWORK)
When the copy is complete, you will see the message:
Library QCICSSAMP copied to library CICSWORK
This leaves QCICSSAMP as a backup in case of errors. CICSWORK is your working copy and is referred to in the rest of this chapter.
Note: If you choose to use a different library name, all references to CICSWORK in the following sections should be replaced by your own library name.
Step 2. Adding libraries to the OS/400 library list
To use some of the OS/400 CL commands, you need to add the CICSWORK library to the OS/400 library list. You do this by issuing the following command:
ADDLIBLE CICSWORK
When the library has been added, you will see the message:
Library CICSWORK added to the library list
Before you attempt to compile the sample program, you should add the QCICS library to the OS/400 library list. File QLBLSRC in this library holds four copybooks necessary for the compilation of the sample program. You add this library by issuing the following command:
ADDLIBLE QCICS
When the library has been added, you will see the message:
Library QCICS added to the library list
The DSPLIBL CL command shows the entire library list. The EDTLIBL CL command shows the user part of the library list and allows you to change items in the library list.
Step 3.Translating the BMS map
Basic Mapping Support (BMS) is the component of CICS/400 that handles the display, mapping, and receiving of data at display terminals. The layout of data is described to BMS in objects known as maps. A map consists of:
Translating the BMS map using the CRTCICSMAP CL command produces physical and symbolic map objects from the source definition. These objects are used during execution of the sample program. Translation also produces a COBOL/400 copybook, which is later copied into the COBOL programs during compilation.
For this sample program, CRTCICSMAP translates the source member ACCTSET of the file QMAPSRC to the physical map object ACCTSET and the symbolic map member ACCTSET of file QLBLSRC. If the copybook but not the source file is specified in the COPY statement of the COBOL program, the COBOL compiler assumes that the copybook source is in QLBLSRC. Therefore it is recommended that all copybooks are held in QLBLSRC.
To translate the map, enter:
CRTCICSMAP
on the CICS/400 command line. Press PF10 to display the additional parameters.
Figure .The Create CICS Map Screen
Notes:
Step 4. Translating the program
Translate and compile the COBOL programs (ACCT00, ACCT01, ACCT02, ACCT03, and ACCT04) using the CICS/400 supplied CL command CRTCICSCBL. To translate the program, enter:
CRTCICSCBL
You need type only in the three fields indicated. The remaining fields have acceptable defaults.
Figure . The Create CICS COBOL screen
Notes:
Program objects for each of the sample programs are supplied in the library CICSWORK, but you may recompile them all if you wish. To compile the other programs,repeat the CRTCICSCBL command, making the same entries in the same three highlighted fields, changing the Program field as necessary to ACCT01, ACCT02, and so on.
Step 5.Creating the recoverable/nonrecoverable resources
In the QCICS library there are two sample files: AAEGCICSTR, which is used for recoverable temporary storage and transient data queues, and AAEGCICSTN, which is used for nonrecoverable temporary storage and transient data queues. These files need to be copied from the QCICS library to the CICSWORK library. Use the OS/400 CL command CRTDUPOBJ to copy them, noting that the four characters following AAEG are the four-character CICS/400 system ID. For this IVP, use SAMP as the system ID. Enter the following commands:
CRTDUPOBJ OBJ(AAEGCICSTR) FROMLIB(QCICS) OBJTYPE(*FILE)
TOLIB(CICSWORK) NEWOBJ(AAEGSAMPTR)
CRTDUPOBJ OBJ(AAEGCICSTN) FROMLIB(QCICS) OBJTYPE(*FILE)
TOLIB(CICSWORK) NEWOBJ(AAEGSAMPTN)
Step 6.Journaling the CICS/400 recoverable resources
Set up an OS/400 journal file for the previously-created recoverable file AAEGSAMPTR. To do this, enter the following commands:
CRTJRNRCV JRNRCV(CICSWORK/SAMPJRNRCV)
TEXT(’Journal receiver for CICS/400 system id SAMP’)
CRTJRN JRN(CICSWORK/SAMPJRN) JRNRCV(CICSWORK/SAMPJRNRCV)
TEXT(’Journal for CICS/400 system identifier SAMP’)
Start journaling the recoverable physical file by entering:
STRJRNPF FILE(CICSWORK/AAEGSAMPTR) JRN(CICSWORK/SAMPJRN)
IMAGES(*BOTH)
You will see the message
Step 7. Defining the CICS/400 resources
In most cases, you would not use a program to define resources. You would use a CL command or a menu-driven approach using the CEDA transaction. For the IVP, a program to define resources has been supplied, to speed up the resource definition stage.
This program is in member ACCTRES in file QCLSRC in library CICSWORK. To run the IVP you do not need to make any changes to it but the source is provided in case you wish to make any changes to it later.
Step 8. Creating the CL program
To create the OS/400 CL program from this source you use the OS/400 CL command CRTCLPGM.
Alternatively, if you are interested only in creating the object, you can enter:
CRTCLPGM PGM( CICSWORK/ACCTRES ) SRCFILE( CICSWORK/QCLSRC ) SRCMBR( ACCTRES )
When this program has been compiled, run it by entering the following:
CALL CICSWORK/ACCTRES CICSWORK
whereCICSWORK is the name of the target library.
This program runs for several minutes (depending on size and loading of your OS/400) and creates all the resource definition objects required by the sample program in the named library, using the details supplied. When this has finished successfully, you can start up the CICS/400 control region.
Figure . Resource definitions for the IVP
Notes: The following notes apply to the above source:
Step 9.Starting the CICS/400 control region
In this example, the control region is run as a batch OS/400 job. To do this enter the following:
SBMJOB CMD( STRCICS CTLRGN( SAMP ) STRTYPE( *COLD ) SITLIB( CICSWORK ) SITGRP( ACCT ))
where SAMP is the four-character system ID that you specified earlier when you created the TD and TS files.This command submits an OS/400 job and you must make sure that any additional parameters that you may want to specify, like job description, are added to the command invocation string.
When the job has started, you watch its progress by using the OS/400 CL command
WRKACTJOB
Pressing PF5 while this screen is active refreshes its contents. When the status of the control region job has changed to DEQW, you can start the sample transactions.
Step 10. Starting the sample transaction
To start the sample transaction, enter the following from an OS/400 CL command line:
STRCICSUSR CTLRGN(SAMP) TRANID(ACCT)
where SAMP is the four-character CICS/400 system identifier specified earlier. The terminal that you use to do this should be one that you specified earlier in the TCT entries.(The DEVD parameter of the ADDCICSTCT CL command identifies the name of the OS/400 device that can be used.) If the terminal from which you issue the command has not been specified in the TCT entry, there is a small delay while CICS creates the necessary internal definitions for the terminal to work with this transaction.
You will now see the first data entry screen of the sample transaction.
The appearance of this screen verifies that the IVP has completed successfully. You do not need to do anything other than press CLEAR to exit. However, ACCT provides a simple update application that enables you to add, update, and delete records to verify further that your system has been installed correctly.
When you are satisfied that you have completed your IVP, end the control region by typing:
ENDCICS SAMP
|
|
IBM - AS/400 Related Tutorials |
|
---|---|
IBM - RPG Tutorial | IBM Cognos Tutorial |
IBM DB2 Tutorial |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.