AS 400 Concepts - skill-at/AS-400-Training GitHub Wiki

image

Introduction to AS/400


  • The Application system/400 was the result of the “Silver Lake project” at IBM’ - on 21st June 1988
  • Renamed as I-series in 2000 and in 2008 System P or Power System
  • Was to replace the aging S/36 and S/38 systems.
  • The AS/400 is a mid-range application system from IBM which has a unique position in the market due to its strong features of security, availability and ease of operation.
  • It is multi user and multi tasking system
  • It is very secure system hence used for the industries which requires sensitive data to be stored and processed
  • Any user can be limited to access/process only particular information on the system.

System Architecture


  • Fully integrated hardware and software components provided in the system.

  • There are three categories of software on the AS/400:

    • Application Software
    • Operating System Software
    • System Licensed Internal Code (SLIC)

USER -- Application S/W -- OS S/W -- SLIC --- Hardware

Application Software –

  • This is the top layer of software that performs user tasks and acts as the primary interface between the user and the AS/400.
  • This includes system-supplied functions like PDM (Program Development Manager), purchased software.
  • This software can also execute or call the OS programs.

Operating System Software :

  • Manages the system resources. It includes common OS functions like copying and deleting files, which can be invoked by application programs through CL (Control Language) commands.

SLIC (System Licensed Internal Code):

  • The deepest layer of software, is an IBM-supplied set of programs that provide the database, security, communications, and other essential functions. Users never interact directly with the SLIC, and it cannot be tampered by programmers or system operators.
  • This layer insulates the applications from changing hardware characteristics

Features of Mid-range Machines:


  • These are generally medium sized computers and are between microcomputers and mainframe computers in terms of processing speed, storage capacity and * the number of users that can be supported at once.

  • Microcomputers may not provide speed and storage capacity to the required extent.

  • The no. of users supported is also less.

  • Mainframes, inspite of having all the above facilities are very costly and require specialized personnel for their set-up and maintenance and also occupy a lot of space with special environmental conditions.

  • The machine comes with an in-built operating system – OS/400 an Every AS/400 has DB2/400 as pre-installed.

image

Industry uses


  • Manufacturing
  • Distribution
  • Retail
  • Entertainment
  • Construction
  • Banking
  • Pharmaceutical
  • Telecom
  • Medical
  • Automotive
  • Education

OS/400:


  • Controls all of your interactions with the AS/400 system.
  • From your work station, the OS/400 system allows you to:

  • Sign on and sign off

  • Interact with the displays

  • Use the online help information

  • Enter control commands and procedures

  • Respond to messages

  • Manage files

  • Run utilities and programs.

Client Access Software:


  • Enable communication between client and server.
  • IBM Personal Communication
  • RENEX
  • MOCHA SOFT (TN5250)
  • RUMBA/400

Utilities


  • IBM has provided some utilities along with system that help developer while building application.

  • They are called as Application Development Tool Set (ADTS).

  • SEU – Source Entry Utility – used to code the programs, structure of database files etc.

  • DFU – Data File Utility – used to make data entry directly in to the database files.

  • SDA – Screen Design Aid – used to create User Interface, i.e., the screens used in interactive programs.

  • RLU – Report Layout Utility – used to design the layouts of the reports that are going to be used in the programs.

  • PDM – Program Development Manager – an in-built utility for the user to navigate through various source physical files etc.

ASP: Auxiliary Storage Pool


  • The logical partition on AS/400 is called as Auxiliary Storage Pool (ASP). The ASP is like C drive D drive etc on Personal Computers except that the ASPs on AS/400 are numbered.
  • Within ASP are what are called as Libraries.

image

AS/400 Library


  • A library is a system object that serves as a directory to other objects.
  • A Library is a collection of objects.
  • Libraries provide a method for organizing objects.
  • Libraries themselves are objects.
  • QSYS is the only library that contains other library.
  • QSYS is the root library where the entire user defined/ system defined library is created.
  • When you logon the first library to be load is QSYS. The system library is loaded at the first time.

Library Types


1. System library:

  • All IBM supplied library e.g. QSYS, QHLPSYS, QUSRSYS…
  • System library is the library that contains the objects that was created at the time OS400 was installed.
  • System supplied libraries begin with the letter "Q" or "#".
  • When you logon the first library to be load is QSYS. The system library is loaded at the first time.

image

2. Product Library:

  • Whenever IBM product is used it is added to the library automatically and is removed itself when the job completes.

3. Current Library:

  • Current library is the working library i.e. all the work done by you is stored in current library. CHGCURLIB

4. User Library:

  • created by the user.

image

*PROD

During library creation using CRTLIB command the default value for the Library type is *PROD i.e. production library. If we create a library of type *PROD then it specifies that whether or not database files in a production library can be opened for updating records, or for adding new records, while the job is in DEBUG mode.

If we specify *NO in the update production files (UPDPROD) parameter on the Start Debug (STRDBG) command then Database files in production libraries cannot be updated while the job is in debug mode. Database files can be opened for reading purposes only.

image

*TEST

All the objects present inside the Test libraries can be updated during testing even if UPDPROD is specified as *NO on the Start Debug (STRDBG) command.

Library commands in AS400


  • Display Library List (DSPLIBL) : To display all types of libraries
  • Create Library (CRTLIB): command is used to create a library.
  • Display library (DSPLIB) :It gives the information of all objects that resides in the library.
  • Edit Library List (EDTLIBL)
  • Add Library List Entry (ADDLIBLE)
  • Work With Libraries Using PDM (WRKLIBPDM)

Note : For one job max of 25 libraries can be defined.

Library List

To find an object we need to provide its path, so here we must qualify an object with the library name for its searching, for example, LIB1/FILE1 which means we are pointing to an object named FILE1 in library LIB1.

What about when we do not qualify the objects with their library name or we do not provide the path where to find that object then how the system decides where to look for that object the answer is an object called a library list (*LIBL) in AS400 which is similar to PATH in Unix and MS-DOS.

This library list specifies which libraries will get searched and in what order for an object.

Display Library List (DSPLIBL)

CL command DSPLIBL is used to display the library list.

image

What you see above from the DSPLIBL screenshot shows you the type of libraries such as SYS(System library), CUR (Current library), and USR(User library) as part of the library list.

Note : For your information, we can have a maximum of up to 15 system libraries and 250 user libraries in the library list.

A Job/session library list consists of four sections namely, SYS, PROD, CUR, and USR.

System portion

The system libraries are always present at the top of the library list such as QSYS, QSYS2, QHLPSYS, QUSRSYS as shown in the above DSPLIBL screenshot. There can max 15 System libraries present on the library list.

Please note that the default system libraries portion on the library list is specified in the system value QSYSLIBL.

To see the content of the system value QSYSLIBL use the following command on the command line.

  • DSPSYSVAL/QSYSLIBL
  • System part of the library list

image

Product portion

When any CL command got executed then the product library for that CL command gets added to the library list and removed once that command ends.

Current Library

This is a special library that is associated with the User profile so once users log in this library is added to the library list automatically and there can be only one current library at a time on the library list. In our case, the current library is EASYCLASS1 if you refer above DSPLIBL screenshot.

You can change the current library at any time using the CL command CHGCURLIB on the command line.

image

User portion

This comes at the last of the library list that contains all the user-specified application libraries. Some user libraries are QTEMP, QGPL, etc. Users can add the library to the library list, edit the library list, change the library list and remove the library from the library list as follows.

  • The user portion of the library for any Job can be stored in JOBD (Job Description) so that when a Job starts it will use the library list specified on the JOBD.
  • But Job descriptions can have a value of *SYSVAL which means that library list information must be looked into the system value QUSRLIBL.

DSPSYSVAL QUSRLIBL

image

ADDLIBLE (Add library list entry)

  • Add a user library to the library list at some position on the library list such as *FIRST, *LAST, etc

image

EDTLIBL (Edit Library List)

image

CHGLIBL (Change Library List)

image

RMVLIBLE (Remove Library List Entry)

image

Source physical file

It basically contains the different types of source members which contain the source code either in RPG, CL, COBOL, DDS, SQL, etc. Those source members are not an object until and unless they are not compiled.

Create command

CL command CRTSRCPF is used for creating a source physical file inside the library.

image

FILE

provide source physical file name in this parameter, some standard source file names are QRPGSRC(RPG source), QRPGLESRC(RPG ILE source), QDDSSRC (DDS source), QDDLSRC (SQL source), QCLSRC (CL source), QCMDSRC (Command source), etc, and the library where you want to create it.

RCDLEN

provide the record length of the source physical file i.e. the number of bytes in the length of records stored in the source physical file. The record format of the source physical file contains three fields.

  • Source sequence number
  • Date
  • Source statement

The default record length is 92 bytes. The source sequence number contains 6 bytes, Date 6 contains bytes and the source statement contains 80 bytes.

The interesting thing here is 6 bytes for the source sequence number and 6 bytes for the date are fixed formats means 12 bytes are fixed and the rest would be for the source statement and for your information the record length can be up to 32766 bytes. So the record length valid values range from 13 to 32766 bytes. Sizes for some of the standard source physical files are as follows.

image

Standard Record Lengths of SRCPF

  • QRPGSRC, QDDSSRC, QDDLSRC, QCLSRC, QCMDSRC, etc - record length of 92
  • QRGLESRC - a record length of 112 (92 default + 20 bytes of comment)

Additional parameters

Once you took F10 on the CRTSRCPF command prompted through F4 will show additional parameters as follows where you see MAXMBRS parameter where you specify a maximum number of members that can be added to the source physical file.

image

Press F10 again will show you some more additional parameters.

  • Example: Create a source physical file

CRTSRCPF FILE(EASYCLASS1/TESTSRCPF)

image

WRKMBRPDM

WRKMBRPDM command is used on the command line of AS400 to browse all the source members of a source physical file. Took F6 on WRKMBRPDM to add any new source member of any type to the source physical file.

image

Using the Source Entry Utility (SEU)

  • We can use SEU to start editing the source member and we use the CL command STRSEU from the command line to start SEU.
  • This will create or open the source member TEST of type RPGLE in the source physical file provided in Edit mode.

image

Source physical file - Points to remember

  • Source physical file is a file which contains the sources of different types of objects.
  • There can be up to 32767 members.
  • Source physical file is an object. But the source member is not an object. When we compile the member, the object is created for that source.
  • System default length of Source physical file 92
  • Recommended length of Source physical file 112

Note: If we are copying the source code from one source file of length 112, we must assure that the target source file must be of length 112, else the source code will be truncated.

Related commands:

  • Create Source Physical file CRTSRCPF FILE(DEMOLIB/QRPGLESRC) RCDLEN(112) TEXT('SOURCE PHYSICAL FILE')
  • Display File Description (DSPFD)

image

The hierarchy of the common OS/400 entities is displayed in the following diagram

image