- 論壇徽章:
- 0
|
Author avid Mount
########## 請(qǐng)保留下面信息 ####################
作者:Author avid Mount
出處:http://www.texas400.com/BSlogfil.html
翻譯:Eric Kong mail:eric_cc@qq.ccom
關(guān)鍵字: 葡萄牙語 Mainframe AS400 Java 廣州 求職 招聘 獵頭 www.puyufanyi.com
備注:本人Java高級(jí)工程師,初學(xué)AS400,有好的職位,可以跟我聯(lián)系,文章如果翻譯不正確,敬請(qǐng)?zhí)岢?br />
################################################
Create 2 different Logical Files over a physical file
在一個(gè)物理文件的基礎(chǔ)上創(chuàng)建兩個(gè)邏輯文件
In only a few lines of source code, you can create a logical file. This is a way of reading the file with a different key. A logical file is a list of key values that point to the physical file. It does NOT contain copies of the data in the physical file.
只用幾行代碼, 就可以創(chuàng)建一個(gè)邏輯文件了,這是一種有用不同key去讀取物理文件的方法,一個(gè)邏輯文件就是一個(gè)Key的列表,這些列表指向這個(gè)邏輯文件,但是邏輯文件不會(huì)包含物理文件的數(shù)據(jù).
To create a logical file, enter your source statements in a DDS source file member named something like "CUS01". Make sure the member type is "LF". Enter the source code in Figure 1.
通過在DSS文件中輸入代碼創(chuàng)建邏輯文件,例如下面的"CUS01",確保Member的類型是"LF",輸入下面圖1的代碼
The first line tells the compiler that this logical file will re-sequence the records in the physical file named in the " FILE" specification. In this case it is the "CUST" file. Also, notice that here we are using the same record name as the physical file, "CUREC". The only remaining lines are like the last two lines of the physical file source. Then name the fields that you want to use as keys.
第一行告訴了編譯器這個(gè)邏輯文件會(huì)重排物理文件," FILE"的標(biāo)識(shí)符號(hào)表明重排的物理文件CUS,這里要注意的是,同樣使用跟物理文件一樣的記錄名字CUREC,跟物理文件的DDS
相比,只有最下面的兩行,定義了用city和state來做key,
Compile the file by using option 14. This time, the AS/400 will execute the "CRTLF" (create logical file) command. You now can read the customer file in city / state sequence simply be reading the file "CUS01" in keyed sequence.
用PDM界面的14來編譯這個(gè)文件,這次AS/400執(zhí)行的是"CRTLF" (create logical file)命令,你現(xiàn)在就可以用CUS01來,通city和state來順序讀取customer文件,
Now, create a logical file to select only certain records. The "S" type record will select only records that have customer status equal to "A", see Figure 2. Also, this logical file will read the records in customer name sequence.
現(xiàn)在,通過建立物理文件來選擇選擇某些特定的數(shù)據(jù), "S"只會(huì)選擇那些 customer status等于A的記錄,如下面圖2,而且,這個(gè)邏輯文件會(huì)用customer name來順序讀取數(shù)據(jù),
Figure 1 - DDS for Logical File to Re-sequence Order of Records
A R CUREC PFILE(CUS)
A TEXT('CUST BY CITY / STATE')
*
A K CUCITY
A K CUSTAT
Figure 2 - DDS for Logical File to Select and Re-sequence
A R CUREC PFILE(CUS)
A TEXT('CUST NAME/ACTIVE ONLY')
A K CUNAME
*
A S CUSTAT COMP(EQ A)
|
|