CodeGen CreateFile实用程序

CodeGen CreateFile实用程序

CreateFile实用程序允许根据存储库文件或结构定义创建ISAM文件。             

CreateFile实用程序的命令行选项如下:

CreateFile -f <fname> | -s <sname> [-out filespec] [-r] [-h]

    -f <fname>   
          Name of repository file definition to process.

    -s <sname>
          The name of the repository structure definition to process.

    -in <infile>
          Name of JSON input file containing the details of file(s) to create.

    -out <filespec>
          File spec of file to create, overriding repository file spec. Not used with -in.

    -r    Replace existing files. The default is not to replace existing files. Not used with -in.

    -h    Display this usage information.

当基于存储库文件定义创建文件时,密钥规范将由分配给该文件的第一个结构中定义的键确定。当基于存储库文件结构创建文件时,文件规范将由分配给该结构的第一个文件确定。CreateFile假定存储库键定义的定义顺序与它们引用的键相同。假设第一个定义的键是主键,第二个键(如果有的话)是第一个备用键,依此类推。             

-f和-s选项只能用于创建ISAM文件。-in选项可用于创建ISAM和相关文件,但只有在提供包含初始数据的输入文件时才能创建相关文件。             

与-in选项一起使用的输入文件必须是类似于以下内容的JSON文件:

[
    {
      "RepositoryFileName": "CUSTOMER",
      "CreateFile": "DAT:CUSTOMER.ISM",
      "LoadFromFile": "TESTDATA:CUSTOMER.TXT",
      "OverwriteExistingFile": true
    },
    {
      "RepositoryFileName": "OPTIONS",
      "CreateFile": "DAT:OPTIONS.DDF",
      "LoadFromFile": "TESTDATA:OPTIONS.TXT",
      "OverwriteExistingFile": false
    }
  ]

包括“CreateFile”是可选的。默认情况下,使用存储库文件定义的文件规范。             

对于ISAM文件,包含“LoadFromFile”是可选的,如果没有提供,将创建一个空文件。对于相对文件,必须提供一个初始数据文件,并且该文件必须至少包含一个适当长度的记录。              包括“OverwriteExistingFile”是可选的。默认情况下,文件不会被覆盖。

Example 1

C:\> createfile -f CUSTFIL

DAT:customer.ism -> File created.

Example 2

C:\> createfile -s CUSTOMER

DAT:customer.ism -> File created.

Example 3

C:\> createfile -f CUSTFIL -f DAT:customer_save.ism

DAT:customer_save.ism -> File created.

Example 4 

C:\> CreateFile -in CreateAndLoadFiles.json

Where CreateAndLoadFiles,json contains:

 

[

  {

    "RepositoryFileName": "MEMBERS",

    "CreateFile": "CUFILES:MEMB01.DDF",

    "LoadFromFile": "SEQ:MEMB01.SEQ",

    "OverwriteExistingFile": true

  },

  {

    "RepositoryFileName": "ACCOUNTS",

    "CreateFile": "CUFILES:MEMB02.DDF",

    "LoadFromFile": "SEQ:MEMB02.SEQ",

    "OverwriteExistingFile": true

  },

  {

    "RepositoryFileName": "PERSONS",

    "CreateFile": "CUFILES:PERMST.DDF",

    "LoadFromFile": "SEQ:PERMST.SEQ",

    "OverwriteExistingFile": true

  },

  {

    "RepositoryFileName": "CHCARD",

    "CreateFile": "CUFILES:CHCARD.DDF",

    "LoadFromFile": "SEQ:CHCARD.SEQ",

    "OverwriteExistingFile": true

  },

  {

    "RepositoryFileName": "TRANSMAS",

    "CreateFile": "CUTRX:TRANSMAS.DDF",

    "LoadFromFile": "SEQ:TRANSMAS.SEQ",

    "OverwriteExistingFile": true

  },

  {

    "RepositoryFileName": "OPTIONS",

    "LoadFromFile": "SEQ:OPTIONS.SEQ",

    "OverwriteExistingFile": true

  }

]

输出如下:

********************************************************************************

Processing file MEMBERS

 

 - ISAM file CUFILES:MEMB01.DDF replaced

 - Data load command: fconvert -s -it SEQ:MEMB01.SEQ -ai CUFILES:MEMB01.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000004/000004       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 5.8594

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing file ACCOUNTS

 

 - ISAM file CUFILES:MEMB02.DDF replaced

 - Data load command: fconvert -s -it SEQ:MEMB02.SEQ -ai CUFILES:MEMB02.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000004/000004       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 7.8125

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing file PERSONS

 

 - ISAM file CUFILES:PERMST.DDF replaced

 - Data load command: fconvert -s -it SEQ:PERMST.SEQ -ai CUFILES:PERMST.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000003/000003       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 4.7402

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing file CHCARD

 

 - ISAM file CUFILES:CHCARD.DDF replaced

 - Data load command: fconvert -s -it SEQ:CHCARD.SEQ -ai CUFILES:CHCARD.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000003/000003       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 2.9297

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing file TRANSMAS

 

 - ISAM file CUTRX:TRANSMAS.DDF replaced

 - Data load command: fconvert -s -it SEQ:TRANSMAS.SEQ -ai CUTRX:TRANSMAS.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000034/000034       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 34.8965

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing file OPTIONS

 

 - RELATIVE file CUFILES:CUNOPT.DDF will be created

 - Data load command: fconvert -s -it SEQ:OPTIONS.SEQ -or -fr 651 CUFILES:CUNOPT.DDF

 - Data load starting at: 14:43:34

 

                                Summary of Statistics

 

        Records Read/Write: 000005/000005       Errors Read/Write: 0/0

        Exception Records: 0

        Elapsed Time: 00:00:01                  Kb/sec: 0.0049

 

 - Data load ending at: 14:43:34

 

********************************************************************************

Processing summary:

 

 - 6 files created, 0 failed.

 - 6 files loaded,  0 failed.

 

********************************************************************************

 

posted @ 2020-12-15 07:15  吴建明wujianming  阅读(63)  评论(0编辑  收藏  举报