码迷,mamicode.com
首页 > 其他好文 > 详细

Smart/400开发上手1:入门

时间:2016-08-19 11:25:11      阅读:1062      评论:0      收藏:0      [点我收藏+]

标签:

1.介绍

Smart/400是在AS/400之上的开发平台,管理开发、运维的全生命周期。

 

2.设计基础

Introducing Fields

Smart通过字段字典Field Dictionary来存储Field,所有的字段都存在这个大字典里,为了方便Cobol程序的调用,必须事先定义Field。

注意事项:

  • 不要删除字段
  • 字段后缀不能是数字,某些数字结尾的字段是系统定义字段
  • 开发新程序不一定要新建字段,因为已有程序很可能早已定义好了
  • 不超过8个字符

字段类型. Valid values are:
A - Alphanumeric
C - Currency and monetary amount
D - Date
E - Currency amount
M - Monetary
N - Unsigned numeric
S - Signed numeric
T - Time
V - Variable length
Z - Date/Time stamp

Using a Table or Data Set to Hold Data

使用表格和数据集存储数据

  • 表是用来包含引用或“规则”信息的。该信息是静态的。在表项上有最小的验证,比如公司代码是一个典型的表项目。
  • 数据集用来处理业务功能数据,特性是不断变化的数据。

 

可以把数据集看成物理文件Physical File。

在设计完Data Sets后,需要编译。

Compiling the Physical File

编译物理文件

编译物理文件的目的是使400系统感知Data Sets的更改,这么说可能比较形象,就是有点类似从源代码java文件转换为class文件。

命令 : CB xxxxpf pf

如果您修改了现有的数据集,则将:

  • 删除使用数据集的所有逻辑文件LF(LF逻辑文件可以认为是视图文件,是和Cobol沟通的文件)
  • 建立新版本的数据集
  • 将旧数据集的数据复制到新的字段
  • 删除旧的数据集
  • 重建以前已删除的逻辑文件LF

 

逻辑文件

LF逻辑文件可以认为是视图文件

Select/Omit Specification

Test的项:

  • EQ Equal
  • NE Not equal
  • GT Greater than
  • LT Less than
  • GE Greater than or equal to
  • LE Less than or equal to
  • RG Range
  • VAL Absolute value

Logical View Database Files:

  • DTVHPF Logical View Header
  • DTVFPF Logical View Fields
  • DTVRPF Logical View Record Format (multi-format)
  • DTVIPF Logical View Key Fields
  • DTVSPF Logical View Select/Omit
  • DTVJPF Logical View Join Details

 

编译逻辑文件

Compiling the Logical File:  CB XXXX *LF

编译后:

  • The Logical file DDS source is generated and placed in the XXXXXXGEN library, where XXXXXX is the development environment level identifier. This source is
    deleted when the logical file is PROMOTEd or deleted using the DLTOBJLVL/DLTOBJREL command.Each logical file has two separate open data paths (ODPs): read and update. A third open data path accommodates direct access. Each open data path makes available a file area through which the data is transferred, and a file pointer.
  • · The I/O module XXXXIO, where XXXX is the name of the logical file. A Cobol program which interfaces between the data set and the application program. The
    application program calls the I/O module each time access to data is required.
  • · Copybooks XXXXSKM and XXXXKEY, where XXXX is the name of the logical file. These two copybooks are used to ensure the correct format of the file is accessed in the application programs. The Schema copybook holds the parameters required to call the I/O module, and is copied into the working storage of the application program.The Key copybook contains the key fields only and is available to be used in working storage in application programs, i.e. if you are saving a key, use this copybook, thereby ensuring that, if the key changes, the correct version of it will be picked up by the Cobol program. The copybooks are placed in XXXXXXCPY/QLBLSRC (where XXXXXX is the development environment level id).

 

Smart/400开发上手1:入门

标签:

原文地址:http://www.cnblogs.com/starcrm/p/5786800.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!