as400 - 01 - basic concepts

42
Australia | Canada | France | India | New Zealand | Singapore | Switzerland | United Arab Emirates | United Kingdom | United States www.keane.com . ©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. AS/400 Training AS/400 Training

Upload: adinesh262

Post on 15-Oct-2014

143 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: AS400 - 01 - Basic Concepts

Australia | Canada | France | India | New Zealand | Singapore | Switzerland | United Arab Emirates | United Kingdom | United States

www.keane.com. ©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

AS/400 TrainingAS/400 Training

Page 2: AS400 - 01 - Basic Concepts

August 3, 2007 2©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Contents1. Basic Concepts (1 Day)2. DDS - PF, LF, DSPF, PRTF (2 Days)3. Control Language (2 Days)4. RPG/400 (4 Days)5. ILE RPG & Concepts (4 Days)6. Assignment - Project (5 Days)

Page 3: AS400 - 01 - Basic Concepts

Australia | Canada | France | India | New Zealand | Singapore | Switzerland | United Arab Emirates | United Kingdom | United States

www.keane.com. ©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Basic ConceptsOS/400 Basic Concepts

Page 4: AS400 - 01 - Basic Concepts

August 3, 2007 4©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Object Management Terms

• Libraries• Objects• Members• Sources• Spool Files• Output/Messages/Job queues• Device Descriptions

Page 5: AS400 - 01 - Basic Concepts

August 3, 2007 5©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Library

• Libraries provide a method for organizing objects.

• All libraries are stored under QSYS library. • We cannot have a library within a library (only

exception being IBM supplied QSYS). • All AS/400 objects should be stored in a

library. • A library is similar to a directory or a folder in

the conventional file system (DOS/WINDOWS).

Page 6: AS400 - 01 - Basic Concepts

August 3, 2007 6©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Object• On the AS/400, a wide variety of entities are

objects -- files, programs, libraries, user profiles, commands, etc.

• A library contains object name, type (*PGM, *FILE, etc.) and a system managed (transparent) address

• Objects must be unique, by name and type within a library

Page 7: AS400 - 01 - Basic Concepts

August 3, 2007 7©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Member• Data is stored in member(s) in a file• A file can have multiple members• The record format of the file is common across

all the members of a file

Page 8: AS400 - 01 - Basic Concepts

August 3, 2007 8©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Summary

L ib ra ry/O b jec t S tru c tu re

P G M 1

M em b er1 M em b er2

F ile1 O th er ob jec ts

L IB A

P G M 1

M em b er A

F ile2 O th er O b jec ts

L IB B O th er lib ra ries /ob jec ts

Q S Y S

Page 9: AS400 - 01 - Basic Concepts

August 3, 2007 9©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Source File• A source file is a file where the source codes

are maintained• Source code is stored as a member in a

physical file. This file is called as a source physical file and is a customized version of a physical file

Page 10: AS400 - 01 - Basic Concepts

August 3, 2007 10©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Spool Files• Printed output from any program is normally

placed in a spool file. • These spooled files can be displayed or can be

printed.

Page 11: AS400 - 01 - Basic Concepts

August 3, 2007 11©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Output Queue & Job Queue• An Output Queue is an object containing a list

of spooled files. Object type is *OUTQ.• A Job Queue contains the list of batch jobs

waiting to be processed.

Page 12: AS400 - 01 - Basic Concepts

August 3, 2007 12©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Work Management Summary

WRKJOBQ WRKACTJOB WRKOUTQ WRKWTRWRKSPLF

WRKUSRJOBWRKSBMJOB

SBMJOB JOBQ

CALL

Batch

Interactive

OUTQ Writer Printer

Page 13: AS400 - 01 - Basic Concepts

August 3, 2007 13©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Message Queue• All messages on the AS/400 are sent to

Message Queues. • Message Queue Types

• System supplied Message Queue -- QSYSOPR, supplied by IBM.

• Workstation & User Message Queue -- Allocated to user's job at sign-on.

• Job Message Queue -- for every job in the system.• Program Message Queue -- for every program started within

a job

Page 14: AS400 - 01 - Basic Concepts

August 3, 2007 14©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Device Descriptions• A device description is needed to describe a

device to the system. • A device may be a diskette, optical device,

display device, etc.

Page 15: AS400 - 01 - Basic Concepts

August 3, 2007 15©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Job Management Terms• Library Lists• Jobs

• Interactive Jobs• Batch Jobs

• Job Descriptions• Job Logs

Page 16: AS400 - 01 - Basic Concepts

August 3, 2007 16©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Library List• A library list is an ordered list of libraries. • These libraries are searched one by one until

an object is found with the specified object name and type (If the object name is qualified by preceding it with a library, the system searches for the object only in the specified library).

Page 17: AS400 - 01 - Basic Concepts

August 3, 2007 17©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Library List Cont…

QSYSQUSRSYSQHLPSYS

QPDA

QITS

QITSCRMQITSSEDQITSMDS

Search Order

User Part

Current Library

Product Part

System Part

Page 18: AS400 - 01 - Basic Concepts

August 3, 2007 18©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Job• Each piece of work on the system is

considered to be a job.• Each job has a unique name within the system.• Job name consists of a Job Name, Device and

Job Sequence no.• Job name is same as device name for

interactive jobs.

Page 19: AS400 - 01 - Basic Concepts

August 3, 2007 19©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Interactive Job• An interactive job is a job that starts when a

user signs on to a display station and ends when the user signs off.

Page 20: AS400 - 01 - Basic Concepts

August 3, 2007 20©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Batch Job• A batch job is a predefined group of processing

actions submitted to the system.• A batch job will be performed with little or no

interaction between the user and the system. • A batch job is submitted from an interactive

job normally and typically requires a special system environment to run.

Page 21: AS400 - 01 - Basic Concepts

August 3, 2007 21©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Job Descriptions• Information describing environment in which a

Job would be executed• A job description is a collection of job related

attributes - like job priority, date format, library list.

• Same job description can be used by multiple jobs.

Page 22: AS400 - 01 - Basic Concepts

August 3, 2007 22©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Job Log• Job log contains information related to requests

entered for a job, such as commands in the job, commands in a CL program, and messages.

Page 23: AS400 - 01 - Basic Concepts

August 3, 2007 23©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Messages• System• Compiler• User• Program

Page 24: AS400 - 01 - Basic Concepts

August 3, 2007 24©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Messages• On the AS/400 system, communication

between procedures or programs, between jobs, between users and between users and procedures or programs occurs through messages.

• A message is always sent to a message Q. A message can be predefined or immediate

Page 25: AS400 - 01 - Basic Concepts

August 3, 2007 25©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Predefined Message• A predefined message is created and exists

outside the program that uses it.• Predefined messages are stored in message

files and have a message number.

Page 26: AS400 - 01 - Basic Concepts

August 3, 2007 26©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Immediate Messages• Immediate messages are those that can be

composed on the fly

Page 27: AS400 - 01 - Basic Concepts

August 3, 2007 27©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Predefined Vs Immediate Messages• Predefined messages -- provides

standardization, runtime customization, no recompilation required if a message is changed, write once - use many times, second level text

• Immediate messages -- compose on the go, can use SNDMSG, SNDBRKMSG

Page 28: AS400 - 01 - Basic Concepts

August 3, 2007 28©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

System Messages• An example of a system predefined message is,

CPF0006 - Errors occurred in command• System messages are stored in the file

QCPFMSG in the library QSYS

Page 29: AS400 - 01 - Basic Concepts

August 3, 2007 29©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

User Messages

• Use SNDMSG or SNDBRKMSG or SNDUSRMSG to communicate with the system users.

Page 30: AS400 - 01 - Basic Concepts

August 3, 2007 30©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Program Messages• Messages can be sent from one program to

another program within a job using SNDPGMMSG.

• Job and program message Qs are automatically created and deleted as jobs and programs begin and end.

Page 31: AS400 - 01 - Basic Concepts

August 3, 2007 31©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands• Command - Max 10 characters• Always has a Verb + Subject form• Commands may have parameters (Most do)• Parameters for a Command can given in 2

ways• Keyword Form - Each parameter has to be specified

along with the keywordCommand kywrd1 valu1 kywrd2 valu2 kywrd3 valu3

• Positional Form - Parameters has to be specified in a predefined order

Command value1 value2 value3

Page 32: AS400 - 01 - Basic Concepts

August 3, 2007 32©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)• ADDLIBLE -- Add Library List Entry -- to add a library to the

user portion of the library list. By default the library is added on top of the existing library list

• EDTLIBL -- Edit Library List -- to edit the current user portion of the library list. New libraries may be added, libraries in the current list may be removed and the positions of the libraries may be changed using this command

• SBMJOB -- Submit Job -- to submit a job for batch processing into a JobQ. Jobs that need minimum or no interaction from the user and long running jobs are normally submitted as a batch job. System would send a completion message once the job is over

• CRTLIB -- Create Library -- to create a new library

Page 33: AS400 - 01 - Basic Concepts

August 3, 2007 33©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)• CHGCURLIB -- Change Current Library -- to set a

library as the current library. If a current library is not set, the default current library is QGPL

• DSPMSG -- Display Message -- to display the messages from a specific message Q like workstation message Q, user message Q or QSYSOPR

• DSPJOB -- Display Job -- to display the details pertaining to a job - like job start date, current status, files used, programs running, spool files, library list, etc.

• WRKSPLF -- Work with Spool Files – to display/print/delete spool files

Page 34: AS400 - 01 - Basic Concepts

August 3, 2007 34©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)

• WRKSBMJOB -- Work with Job submitted from the workstation, job or user profile -- to display, change the submitted jobs (jobs running in batch).

• CRTSRCPF -- Create Source Physical File -- to create a source physical file. Source physical file is a customized version of a physical file, its record length is normally 92. This file is used to hold the source codes.

• CHGJOB -- Change Job -- to change the run time parameters of a job - like JobQ, priority, scheduling, OutputQ, date format, etc.

• CRTPGM -- Create Program -- to create a program object from a set of modules

• CRTRPGMOD -- Create RPG Module -- to compile the RPG source into a module object (*MODULE)

Page 35: AS400 - 01 - Basic Concepts

August 3, 2007 35©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)• CRTRPGPGM -- Create RPG Program -- to start the RPG

compiler• DSPJOBLOG -- Display Job Log -- to display the job log -

lists the commands used in the job so far and the messages

• MOVOBJ -- Move Object -- to move an object from one library to a different library (that is the object is removed from the current location and placed in a different library)

• STRDBG -- Start Debug -- to start debugger -- puts a job (and adds programs) into debug mode

• STRISDB -- Start Interactive Debugger -- to start the interactive source debugger. This command provides an interactive debugging environment for CL, RPG and COBOL programs

Page 36: AS400 - 01 - Basic Concepts

August 3, 2007 36©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)• STRPDM -- Start Program Development Manager -- to start

Program Development Manager - an application development tool provided along with the AS/400

• WRKUSRPRF -- Work with User Profile -- to maintain the user profiles. User profiles may be added, changed, deleted with this command

• WRKACTJOB -- Work with Active Job -- to work with performance and status information for the active jobs in the system

• WRKUSRJOB -- Work with User Job -- to work with a selected user jobs.

• WRKMSGF -- Work with Message Files -- to maintain the message files. This command may be used to create, change (the message descriptions) and delete a message file

Page 37: AS400 - 01 - Basic Concepts

August 3, 2007 37©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

OS/400 Commands (Cont . . .)UPDPGM -- Update Program -- This command

may be used to replace the modules in a bound program with other modules. The bound program need not be recompiled when a module is replaced

Page 38: AS400 - 01 - Basic Concepts

August 3, 2007 38©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

AS/400 Security ConceptsObjectives

• Confidentiality• Protecting against disclosing information to unauthorized people• Restricting access to confidential information

• Integrity• Protecting against unauthorized changes to data• Restricting manipulation of data to authorized programs

• Availability• Preventing accidental changes or destruction of data• Protecting against attempts by outsiders to abuse or destroy data

Layers of Security• To access any resource from the AS/400, a user ID and a

password is necessary• At the lowest level, security can be implemented at the field

level for a file

Page 39: AS400 - 01 - Basic Concepts

August 3, 2007 39©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

Levels of Security• Level 10 -- Physical Security • Level 20 -- Password Security • Level 30 -- Full resource security. This is the

level of security implemented in most systems.

• Level 40 -- Restricted access to system interface. This is to prevent unauthorized access through communications and APIs. The AS/400 system when shipped is at level 40.

• Level 50 -- Highest level of security. Intended to support the security standards set by US department of defense. Not used generally.

Page 40: AS400 - 01 - Basic Concepts

August 3, 2007 40©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

AS/400 Security (Cont…)• User Profile

• User profile is an AS/400 object identifies the user to the system

• Source of authority for the system to refer to when the user requests services

• The User profile consists of • User Name• Password• Owned Objects• Authorized Objects• Scheduling Priority• Special Authority• Save system rights• Job control rights• Initial Program - Program that is called upon user log on.• Job Description

Page 41: AS400 - 01 - Basic Concepts

August 3, 2007 41©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

AS/400 Security (Cont…)• Classes of User Profile

• Determines what option the user sees on menus• Determines what functions the user is allowed to do• The user classes are

• Security Officer (*SECOFR)• Security Administrator (*SECADM)• Programmer (*PGMR)• System Operator (*SYSOPR)• User (*USER)

Page 42: AS400 - 01 - Basic Concepts

August 3, 2007 42©2007 Keane. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane. Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.

AS/400 Security (Cont…)Special Authorities

• In addition to the regular functions these can be assigned to any user to enhance their access.

• *ALLOBJ - authority to perform all operations on objects• *SECADM - allows user to work with user profiles on the system• *JOBCTL - allows the user to control all jobs and printing • *SPLCTL - unrestricted control of batch jobs and output queues• *SAVSYS - authorizes the user to save and restore objects• *SERVICE - authorizes to perform software services • *AUDIT - authority to define Auditing characteristics• *IOSYSCFG - configure Input/Output devices

Related Commands• CRTUSRPRF - Create user profile• CHGUSRPRF - Change User Profile• DSPUSRPRF - Display User Profile• CHGPWD - Change Password