2012-9-27

来源:互联网 发布:linux查看80端口被占用 编辑:程序博客网 时间:2024/05/29 19:22

1. Objects

Everything on AS/400 are objects characterised by its type.

eg,   *AUTL    Authorization List

*CMD     Command Definition

       *DEVD   Device Description

*FILE     File

*PGM                    Program

*JOBD    Job Description

*JRN      Journal

       *OUTQ   Output queue

    ...   and many more

 

DSPOBJD command to display the object attribute.

Other Attribute

Attribute

Owner

Creator

Date/time last changed

(and other type related attributes)

 

2. Library

 

Three Level Structure: Library, Object, Member.

       Objects are under Library, and Members are included in Object.

1.       Library is a special object.

2.       Source belongs to MBR type

3.       Program belongs to OBJ type

 

Library + Name + Type uniquely identifies an object.

e.g ASID159301 + ZTRANS0P + *FILE

 

Display Library:    DSPLIB LIB(ASID159301)

Work with OBJ:    WRKOBJ OBJ(ASID159301/ZTRANS0P)

Work with MBR:   WRKMBRPDM FILE(ASIC159301/QRPGLESRC) MBR(AATC000R)

 

IBM Supplied Libraries

QSYS: System Library, contains IBM supplied programs, data, other library descriptions, and many other objects.

QGPL: General Purpose Library, contains general objects to be accessed by all users. Any user on the system can use this library, however not recommended.

QTEMP: Temporary Library, automatically created for each job on the system. Last only for the duration of the job. Useful for storing temporary objects.

 

DSPOBJD OBJ(QSYS/Q*) OBJTYPE(*LIB) to list all IBM supplied libraries.

 

Library List

Library List (*LIBL) is a list of libraries which the system will use when searching for requested objects. We can define different library list on the same LPAR. Every job on AS400 is running under certain library list, it’s like an environment which jobs use to search for objects.

 

EDTLIBL

DSPLIBL

ADDLIBLE

RMVLIBLE

 

3. Work Management

Interactive Job

Batch Job

 

WRKJOB

WRKACTJOB

CHGJOB

SBMJOB

ENDJOB

 

4. Files

4.1 Source File

Source File =  physical file of 92 bytes (for RPGLE source, its length is 132) record length and multiple members to store different source in the same source file

(1)   CRTSRCPF

(2)   Enter SEU via:

STRSEU                                                                      

Programmer menu (GO PROGRAM opt 1)                             

WRKOBJPDM (option 12 against the appropriate source file)

(3)      Source files are deleted like normal file                                    

DLTF

 

4.2 Database File

A physical file can contain only one record format. Data is stored in physical file.

A logical file determines how data records are selected and defined when read by an application program. A logical file can be a simple, multiple format, or join logical file. A logical file does not store data.

 

We can apply record locking and commitment control facilities to ensure data integrity.

WRKOBJLCK OBJ(ASID159301/ZTRANS0P) OBJTYPE(*FILE)  

STRCMTCTL LCKLVL(*ALL) CMTSCOPE(*JOB) 

One physical file can have more than 1 members.

CRTPF FILE(KXIE/PAYROLL)

             SRCFILE(KXIE/PAYROLL)

 MBR(PAYCO1)

       MAXMBRS(3)

ADDPFM FILE(KXIE/PAYROLL)

         MBR(PAYCO2)

ADDPFM FILE(KXIE/PAYROLL)

MBR(PAYCO3)

 

Logical file

1. view only certain records/rows

2. view only certain fields/columns

3. view 2/more related files as one (joining)

CRTLF FILE(KXIE/RAYROLL1) SRCFILE(KXIE/PAYROLL1)

 

4.3 Naming Convention

Physical File

Product / Owner Prefix – 1 Byte

Component ID (or Free form) – 3 Bytes

File Description – 2 Byte

Constant – 1 Byte

File Suffix – 1 Byte

e.g. ADDCCM0P; ZTRANS0P; ZPARCT0P

Logical File

Product / Owner Prefix – 1 Byte

Component ID (or Free form) – 3 Bytes

File Description – 2 Bytes

Sequence Number – 1 Byte

File Suffix – 1 Byte

e.g PHYPDT1L; SVIPNX2L; ZMODCT3L

 

4.4 Work with Data

AS400 standard (DFU):

UPDDTA

Euronet Utility:

WRKDBF – Add, update, delete records

UPDPFM – Update records

 

RUNQRY

STRSQL

 

 

原创粉丝点击