#
AE-L與AF-L功能鍵 從這個功能的使用上,可能會很容易看得出專業(yè)玩家與業(yè)余攝友之間的差別,因為有些人玩相機(jī)很多年,甚至還不知道這個功能是什么。

AF-L是“自動對焦鎖定”,當(dāng)你半按快門對焦完畢后并打開AF-L后,相機(jī)只會鎖定在你半按快門時的那個焦距,當(dāng)你無論轉(zhuǎn)移到任何角度,相機(jī)都會鎖定在你之前半按快門時的那個焦距上。適合用于運動攝影,進(jìn)行定點捕捉闖進(jìn)畫面內(nèi)的物體等。 AE-L即“自動曝光鎖定”,它的意思是,當(dāng)你構(gòu)圖后,相機(jī)會根據(jù)畫面來判斷需要多少的曝光量,隨著畫面移動,比方說從一個暗地方到亮地方,這個過程里相機(jī)對曝光量一定是會變化的。但AE-L打開的話,照相機(jī)會鎖定你之前半按快門時的曝光量,拍攝別的東西的時候,光圈快門都不會變化。適合統(tǒng)一曝光下進(jìn)行接片的拍攝等。
With subfiles you can create a display file with lists of items. Let's see how that's done. 利用子文件我們可以創(chuàng)建帶有列表項目的顯示文件,現(xiàn)在我們就看看是如何創(chuàng)建的 A subfile is a display file where you can place a listing of values and process changes on the list. The list of members that you can see in the PDM is an example of a subfile. 子文件是一個顯示文件,它能夠幫助你顯示列表和在列表上作相應(yīng)的處理,你在PDM上能看到的列表成員就是你的一個子文件 In this chapter we'll create a subfile which will show all the cards from a client given its ID. To make the manipulation of several tables easier, we'll create a view with the fields we'll use on the subfile. In STRSQL insert this code: 在這一章,我們將要創(chuàng)建一個子文件,它用于根據(jù)特定的ID顯示所有的卡,為了更好地維護(hù)幾張表,我們創(chuàng)建一個表包含多個我們將要用在子文件的字段,在STRSQL中輸入這些代碼 CREATE VIEW CLICARD AS SELECT CL.ID_CLI, CR.ID_CRD, SH.NAME_SHP, CR.SHOP_CRD FROM DEMO/CLIENTS CL, DEMO/SHOP SH, DEMO/CARDS CR WHERE CL.ID_CLI = CR.CLIENT_CRD AND CR.SHOP_CRD = SH.ID_SHP Open SDA (STRSDA) and create a new member: 打開SDA創(chuàng)建一個新的成員 
Create a BOTTOM record that should look like this: 創(chuàng)建一個Bottom記錄像如下 And the TOP record like this: 和Top記錄 Let's create the subfile now. Create a new record, name it LIST, the record type is SFL: 現(xiàn)在我們開始創(chuàng)建子文件了,創(chuàng)建一個新的記錄,名字為LIST,記錄的類型是SFL When you press Enter a new record appears. Write SFLCTL on it: 現(xiàn)在我們按下回車,一個新的記錄出現(xiàn)如下,在上面寫下SFLCTL如圖 This field creates a subfile control record, which works like the heading on the list. 這個字段用來創(chuàng)建子文件控制記錄,就像列表的頭部 You have to activate some options now: 現(xiàn)在你需要激活下面的選項 On the General Keywords menu insert the data you see below: 在General Keywords菜單輸入輸入如下 These indicators allow us to manipulate the status of the subfile from the RPG code. Press Enter to go back to the previous screen. Select Subfile display layout. 這些指示器允許我們利用RPG代碼維護(hù)控制控制子文件的狀態(tài),輸入回車我們會返回之前的屏幕界面,現(xiàn)在選擇子文件的顯示布局 On subfile maximum size type 9999 and on the number of records for page type 9: 在子文件的最大值輸入9999和頁面的最大記錄數(shù)輸入9 Press enter to go back. Select the option Select Record Keyword: 輸入回車返回,然后選擇字段關(guān)鍵字選項 Choose Overlay keywords: 選擇覆蓋關(guān)鍵字 Select Overlay without erasing: 選擇覆蓋但不擦除選項 Press Enter until you're back on this screen: 輸入回車,然后返回如下 Open the SFLCTL record. By default the record list is already visible on the design screen. Select to visualize the other 2 records, TOM and BOTTOM (F9). 打開SFLCTL記錄,默認(rèn)是這個記錄顯示在設(shè)計界面上,選擇To和Bottom進(jìn)行可視化(按下F9) Back to the design screen, write at the top “Client Nr.”. Select the fields from CLICARD view for input/output (F10) and select the ID_CLI field: 返回設(shè)計界面,在上面寫上“Client Nr.”,在CLICARD試圖中選擇字段ID_CLI作為輸入和輸出, Type the titles of the subfile's columns and a separating line: 輸入分割線和子文件的字段標(biāo)題 Let's add some proprieties to the Client ID field. Place an * before to the left of the field. 現(xiàn)在我們添加一些新的屬性給與Client ID字段,在這個字段的左邊輸入一個* We're going to add an indicator to this field, which will be activated when no record is found for an ID inserted (either the ID doesn't exist or it doesn't have any associated cards). Option Error Messages: 現(xiàn)在我們需要為這個字段添加一個指示器,當(dāng)值一個指定的ID沒有找到記錄(這個ID并不存在或者根據(jù)這個ID找不到記錄)的時候,這個指示器將被激活,在錯誤描述選項的地方輸入Y Insert the following information: 輸入下面的信息 Close this record and open the LIST record. Select the TOP and BOTTOM records for display (F9): 選擇這個記錄并且同時打開這個LIST記錄,選擇Top和Bottom記錄作顯示(按下F9) To create an input field, where the user will type the options, type '+i' on the same position as in the following image and press Enter. 創(chuàng)建一個輸入字段,用戶我在這里輸入選項,我們在如下圖的位置輸入‘+i’然后按下回車 Notice how the field spread across the 9 line you previously defined as the subfile page size. 注意你之前是如何定義子文件的每頁大小為9行 Select the records from CLICARD view for output. 從CLICARD視圖中選擇記錄作為輸入 The fields will probably be listed twice, because the SDA will show you the field that had been previously loaded from I/O in the SFLCTL record. You should select the fields further to the right, because they are the last ones loaded. You must be careful selecting the fields. 這些字段大概會本顯示兩次,因為SDA會把之前加載的字段也被顯示出來,因此選擇字段的時候需要小心一點,盡量選擇那些比較靠右的字段,因為他們是最后被加載的, If there are more fields than the ones that can fit the message line, a plus (+) sign will appear at the end of the line. Press Page Down to see the remaining fields. 假如有很多的字段,消息行顯示不完,在行尾會顯示一個+號,按下翻頁鍵就可以看到剩下的那些沒有顯示的字段。 Place the fields on their positions: 將字段放在相關(guān)的位置 The final result: 最后的結(jié)果 
Don't forget to activate the indicator 03 at file-level so that “F3=Exit” can work and add the keyword INDARA to the code. Check out the Display file chapter if you don't remember how to do this. 不要忘記激活03指示器,在文件的層面,使得“F3=Exit”生效,同時添加關(guān)鍵字INDARA到代碼中去,假如你忘記了怎么做的話,回頭看看第八章的顯示文件創(chuàng)建。 You must add the red line to the SFLCTL record: 你必須為SFLCTL記錄添加紅線 A R SFLCTL SFLCTL(LIST) A SFLSIZ(9999) A SFLPAG(0009) A OVERLAY A 30 SFLDSP A 31 SFLDSPCTL A 35 SFLCLR A 33 SFLEND(*MORE) A 4 8'Client Nr.' A ID_CLI R B 4 19REFFLD(CLICARD/ID_CLI DEMO/CLICARD) A 90 ERRMSG('No Data Found') A 6 4'Op.' A 6 12'Card Nr.' A 6 27'Shop Nr.' A 6 42'Shop Name' A 7 2'__________________________________- A ___________________________________- A __________' A RRN 4S 0H SFLRCDNBR(CURSOR) In the LIST record change the name of the input field to OPTION. By default it must be named FLD001, or something like it. 在LIST記錄中,你必須修改默認(rèn)的輸入字段的名字,因為默認(rèn)是FLD001,或者像如下 A R LIST SFL A OPTION 1A I 9 5 (...) Executing the subfile 執(zhí)行子文件 To run the subfile you must create an RPGLE member. Check out the file QRPGLESRC.SHW_SFL for more details on how to write this member. 要運行子文件,你必須創(chuàng)建一個RPGLE的成員,檢出文件QRPGLESRC.SHW_SFL 查看一下細(xì)節(jié),看看是如何寫這個文件 When you run the RPGLE code: 當(dāng)你運行RPGLE代碼后可以看到下面的結(jié)果 
Display files are DDS files that enable us to create AS/400 menus and screens to interact with the user. Display files can have several records. Each record defines part of the screen's appearance. These records may or may not overlap each other. 顯示文件是一些幫助我們創(chuàng)建和用戶進(jìn)行交互的AS400菜單和屏幕界面的DDS文件。顯示文件能夠包含多個紀(jì)錄,每個記錄定義了屏幕界面的一部分。這些記錄或者相互覆蓋。 The SDA application allows us to “draw” what should show up on the screen and creates the DDS code from our “drawing”. Next we'll create a screen with DDS and afterward we'll look at some code excerpts, because sometimes it's easier to alter the screen through its code. SDA程序允許我們在屏幕上“畫草稿”,它會根據(jù)我們所畫的“草稿”生成相應(yīng)的DDS代碼。下面,我們將要創(chuàng)建利用DDS創(chuàng)建一個屏幕界面,然后查看這些代碼的片斷,因為,有些時候,利用代碼來修改界面還是比較容易些。 In this chapter ,we'll create a screen to show a clients data. 在這一章,我們將創(chuàng)建一個顯示客戶數(shù)據(jù)的界面。 To open SDA type STRSDA on the system prompt. This screen should appear: 在系統(tǒng)命令行輸入STRDA就可以打開SDA程序了,如下圖顯示: 
Choose option 1 and type the options as you see them on the image below. Source file is the file where the code will be stored. Member is the name of member we're creating. 選擇1,然后輸入相關(guān)的選項,如下圖,Source file就是代碼保存的文件了,在Member輸入我們想要創(chuàng)建的成員(Member)。 
Create file 創(chuàng)建文件 Press Enter. A new screen appears. Add a new record, named TOP, typing what you see on the image bellow. 按下回車鍵,然后我們添加記錄,命名為Top,如下圖 
Now specify the record type, in this case it's RECORD: 接著我們輸入記錄類型,在這個例子中我們輸入Record After the Enter an empty screen appears. In this screen you can “draw” the top record. Add the content you see on the image bellow. 按下回車,現(xiàn)在我們就可以“草繪” top記錄,添加內(nèi)容了,如下圖: When you type a string you should place it between apostrophes. If you don't each word will be handled like a different field. Placing the apostrophes allows you to manipulate all the words as a single field. 當(dāng)你想輸入一個字符串的時候,請問打上單引號,假如你不這樣做的話,系統(tǒng)會把他們當(dāng)作分開的不同字符串。 The *USER function shows the username on the screen. There are other functions that retrieve information from the system: *DATE (shows the system current date), *TIME(shows the system current time), *SYSNAME (shows the system name). *USER用來在屏幕上顯示用戶名 *DATE用來在屏幕上顯示系統(tǒng)當(dāng)前日期。 *TIME 用來在屏幕上顯示系統(tǒng)的當(dāng)前時間。 *SYSNAME 用來在屏幕上顯示系統(tǒng)名稱。 
After typing what you see on the image press Enter. Always check what you've done before pressing Enter, because after that you can only alter the screen by manipulating its code. You can also exit the record editing without saving your work, but then you'll lose all you've done since you last opened the record for editing. 按照上圖輸入完成后按下回車,就可以看到下圖了,請在按下回車之前仔細(xì)檢查,因為按下回車之后,只能用代碼進(jìn)行修改了,當(dāng)然,你也可以退出這條記錄而不保存,但是你就會丟失這些工作成果。 Moving a field 移動字段 You can move a field to the right placing “>” characters to the right of the field. The number of > you type will be the number of columns the field will move. To move the field to the left place < signs on the left side of the field. 你可以通過在字段右邊的輸入〉來使字段向后移動,你輸入〉符號的數(shù)量就是字段向右移動的位移量,向左是同樣的道理。 
Centering a field 字段居中 To center a field on the screen place an 'ac' at the left of the field and the 'c' must be overlapping the first character of the field. Then press Enter. Press F3 to finish editing this record. Choose option 1 to save your work: 要是想將字段居中,你可以在字段的左邊輸入ac,c必須覆蓋字段字段的第一個字符,然后按下回車,按下F3結(jié)束你對字段的編輯,選擇1保存你的工作成果。 
Create another record named BOTTOM, the same way you've created the TOP record. 現(xiàn)在我們創(chuàng)建另外一個記錄叫做Bottom,方法是跟創(chuàng)建TOP字段是一樣的。 When you open the new record for editing press F9. This menu will appear: 當(dāng)你打開按下F9對新的記錄,我們可以看見菜單顯示出來了 
So that you don't overlap the records you can choose to visualize other records in the menu. You can see that the status of the BOTTOM record is “In Use” which means it is the one currently being edited. You can select at most 3 records to visualize. To do so place numbers 1 to 3 on the records you want. Select the TOP record and press Enter. 為了不要覆蓋你的其他記錄,你可以選擇在菜單中對其他記錄可視化,你可以發(fā)現(xiàn)Bottom記錄處于正在使用“In Use”狀態(tài),意味著這正是我們正在編輯的記錄,你可以選擇最到3條記錄進(jìn)行可視化,將1,2,3 放在你想可視化的記錄上面,然后按回車 
The names of the selected fields appear on the bottom of the screen. Don't forget you are only “drawing” on the record in use. The other records only help you place your elements on the right place. 可以看到,你所選的字段顯示在屏幕的底部了,但是你不要忘記了,你只能“草繪”那個正在使用(“In Use”)的記錄,其它記錄只能輔佐那個正在使用的字段放置合適的位置而已。 “Draw” something similar to what you see in the next image. Use the underscore to make the line. 像下圖那樣“草繪”我們的需要的界面,我們使用下劃線描述出一條直線來 
Changing field proprieties修改字段屬性 We're going to edit the proprieties of the “F3=Exit” field. Place an '*' at the left of the field and press Enter: 我們現(xiàn)在修改“F3=Exit” 字段的屬性,在這個字段的左邊輸入*, 然后按下回車。 
This screen appears. Place an 'Y' in the Colors option. We're going to change the color of the characters. 當(dāng)出現(xiàn)了下面的界面,在顏色選項中輸入Y, 
Place an 1 in the Blue field: 
Select blue color 選擇藍(lán)色 Press Enter until you're back in the editing screen. The field is now blue. Exit the editing screen (F3) and save your work. 按回車返回,直至你返回編輯界面,現(xiàn)在可以看到字段已經(jīng)變成藍(lán)色了,按F3退出編輯界面然后保存你的工作成果。 Create a new record, MIDDLE, the same way you've created the previous records. 創(chuàng)建一個新的記錄,MIDDLE,方法跟你之前的事一樣的 Press F9 to visualize the records you already created: 按F9可視化你剛剛創(chuàng)建的記錄 
Draw what you can see in the following image. Press Enter when you're done. 
Add fields 添加字段 Using table records 使用表記錄 We're going to select the fields from the Clients table to show them on the screen. Press F10. On that menu select the Database File Clients for output (option 3). You can also select fields for input or input/output choosing one of the other options. You should write this on the menu and press Enter: 現(xiàn)在我們將要在客戶表中選擇我們想要的字段,將他們顯示在界面上面,按下F10,現(xiàn)在第3項(select the Database File Clients for output),你也可以為其它的選項,選擇字段作為輸出和輸入。 
Select the table 選擇表 On the bottom of the screen there's a message with all the Client's field names preceded by a number. To use a field on the screen you should write its correspondent number preceded with an '&'. You can see it in the next image. Be careful, because if you write a number and press Enter the order of the list on the bottom will change. 在下圖中,你可以看到一條信息顯示在最下面,顯示了客戶表的所有字段和字面名字前面附帶著號碼,要將這些字段顯示在界面的,你需要將相關(guān)的字段的號碼寫在屏幕界面上,前邊帶上一個‘&’的符號,如下圖, 
The final result: 最后結(jié)果 
Exit the record editing. We now need to make a few adjustments to the file options. 推出記錄編輯,我們需要對文件選項進(jìn)行一些修改 Record level options (overlay) 記錄層面選項(覆蓋) Choose option 8 to the TOP record: 在Top記錄選擇選項8 
Change overlay option 修改覆蓋選項 Select option Overlay Keywords: 選擇覆蓋關(guān)鍵字 
Change overlay option step 2 修改覆蓋選項第二步 Place an Y at the option Overlay without erasing. This option allows to display this record on the screen together with the others. Press Enter until you reach the menu with the record listing. Activate this option on the other records. 在選項(Overlay without erasing)的地方輸入Y,這個選項允許你在屏幕界面中同時顯示其他的記錄。一路回車直至你看到記錄列表,在其他界面中激活這個選項 
Change overlay option step 3 修改覆蓋屬性步驟3 File level options (indicators) 文件層面的選項(指示器) We need to declare the indicator 03 (so that “F3=Exit” works) at the file level. On the menu with the record listing press F14 (F13=shift+F1; F14=shift+F2; F15=shift+F3, etc.). On the following screen choose the option Indicator Keywords. 要實現(xiàn)“F3=Exit”的功能,我們需要需要在文件的層面聲明指示器03,在字段列表的菜單中我們輸入F14 (F13=shift+F1; F14=shift+F2; F15=shift+F3, etc.).然后,我們選擇指示器選項關(guān)鍵字,如下圖 
Insert the data you see on the image below:按照下圖輸入 
Press Enter until you've reached the starting menu. Press F3 and save the file. 一路回車直至看到開始菜單,按F3保存文件。 Display Files DDS code 顯示DDS文件的代碼 You can check out the code from this display at QDDSSRC, the member is SHW_CLI. At the beginning of the file should be something like this: 你可以查看上面步驟產(chǎn)生的DDS代碼,位置在QDDSSRC,成員名字是SHW_CLI,在文件的開頭我們可以看到這樣兩行: A DSPSIZ(24 80 *DS3) A CF03(03 'Exit') These are the file-level options. You should add a line to this area that later will allow you to rename the indicators used. Add this line after the DSPSIZ line: 這是文件層面的選項,你遲些可以在這里增加一行,它允許你重命名這個已經(jīng)用了的指示器,在DSPSIZ后面添加一行,如下 A INDARA You should also have some lines like these: 你也可以添加幾行像下面的: A R TOP A OVERLAY A 1 65USER A 3 27'Client Details:' In these four lines are the definitions to the TOP record. Notice the OVERLAY option we had defined in SDA. The keyword USER is placed on the 1st line, column 65. 上面四行是關(guān)于TOP 記錄的定義,要注意的是OVERLAY 選項是我們在SDA中定義的,關(guān)鍵字USER被放在第一行,第65列。 Look at this line from MIDDLE record: 現(xiàn)在我們看看MIDDLE的記錄 A ID_CLI R O 8 23REFFLD(CLIENTS/ID_CLI DEMO/CLIENTS) Here you have a reference to the ID_CLI field on the CLIENTS table and this reference is positioned at line 8 column 23, an can only be accessed for reading (O). 這里你定義了一個引用,指向CLIENTS表的ID_CL字段,這個字段的位置在第8行,第23列,是一個只讀的字段。 Compile the file (option 14) after you've closed the member. 關(guān)閉了這個成員之后,你可以按F14編譯這個文件。 Executing display files 執(zhí)行顯示文件 To run the screen you must create an RPGLE member which will handle all the possible events (pressing F3 for example). Check out the file QRPGLESRC.SHW_CLI to see how this member should be defined. Create a file like QRPGLESRC.SHW_CLI and run it. The result should be something like this: 要運行這個界面,你必須創(chuàng)建一個RPGLE成員,來處理所有可能的事件(例如按下F3),打開文件QRPGLESRC.SHW_CLI,看看我們英文怎么定義這個成員,創(chuàng)建一個像QRPGLESRC.SHW_CLI文件,然后我們運行,結(jié)果如下圖, 
Execute display file 1 If you press Enter:
摘要: 一個簡單的例子而已。IDENTIFICATION DIVISION. &nbs... 閱讀全文
The default options that were set up when your compiler was installed are in effect for your program unless you override them with other options. To check the default compiler options of your installation, do a compile and check in the compilation listing. Ways of overriding the default options1.Compiler options can be passed to COBOL Compiler Program (IGYCRCTL) through the PARM in JCL. 2.PROCESS or CBL statement with compiler options, can be placed before the identification division. 3.If the organization uses any third party product or its own utility then these options can be coded in the pre-defined line of the utility panel. Precedence of Compiler Options- (Highest precedence). Installation defaults, fixed by the installation.
- Options coded on PROCESS /CBL statement
- Options coded on JCL PARM parameters
- (Lowest Precedence). Installation defaults, but not fixed.
The complete list of compiler option is in the table: Aspect | Compiler Option | Source Language | APOST, CMPR2, CURRENCY, DBCS, LIB, NUMBER, QUOTE, SEQUENCE, WORD | Date Processing | DATEPROC, INTDATE, YEARWINDOW | Maps and Listing | LANGUAGE, LINECOUNT, LIST, MAP, OFFSET, SOURCE, SPACE, TERMINAL, VBREF, XREF | Object Deck generation | COMPILE, DECK, NAME, OBJECT, PGMNAME | Object Code Control | ADV, AWO, DLL, EXPORTALL, FASTSRT, OPTIMIZE, NUMPROC, OUTDD, TRUNC, ZWB | Debugging | DUMP, FLAG, FLAGMIG, FLAGSTD, SSRANGE, TYPECHK | Other | ADATA, ANALYZE, EXIT, IDLGEN |
ADV: It is meaningful if your program has any printer files with WRITE..ADVANCING keyword. The compiler adds one byte prefix to the original LRECL of printer files for printing control purpose. If you are manually populating printing control character in the program, then you can compile your program with NOADV. DYNAM: Use DYNAM to cause separately compiled programs invoked through the CALL literalstatement to be loaded dynamically at run time. DYNAM causes dynamic loads (for CALL) and deletes (for CANCEL) of separately compiled programs at object time. Any CALL identifierstatements that cannot be resolved in your program are also treated as dynamic calls. When you specify DYNAM, RESIDENT is also put into effect. LIST/OFFSET: LIST and OFFSET are mutually exclusive. If you use both, LIST will be ignored. LIST is used to produce listing a listing of the assembler language expansion of your code. OFFSET is used to produce a condensed Procedure Division listing. With OFFSET, the procedure portion of the listing will contain line numbers, statement references, and the location of the first instruction generated for each statement. These options are useful for solving system ABENDS. Refer JCL session for more details. MAP: Use MAP to produce a listing of the items you defined in the Data Division. SSRANGE: If the program is compiled with SSRANGE option, then any attempt to refer an area outside the region of the table will abnormally terminate with protection exception, usually S0C4.It also avoids any meaningless operation on reference modification like negative number in the starting position of reference modification expression. If the program is compiled with NOSSRANGE, then the program may proceed further with junk or irrelevant data. So usually the programs are compiled with SSRANGE during development and testing. RENT: A program compiled as RENT is generated as a reentrant object module. CICS programs should be compiled with RENT option to share the same copy of the program by multiple transactions (Multithreading) RESIDENT: Use the RESIDENT option to request the COBOL Library Management Feature. (The COBOL Library Management Feature causes most COBOL library routines to be located dynamically at run time, instead of being link-edited with the COBOL program.).CICS Programs should be compiled with RESIENT option. XREF: Use XREF to get a sorted cross-reference listing. EBCDIC data-names and procedure-names will be listed in alphanumeric order. It also includes listing, where all the data-names that are referenced within your program and the line number where they are defined. This is useful for identifying the fields that are defined but not used anywhere after the development of new program.
COMPILATION JCL: //SMSXL86B JOB ,'COMPILATION JCL', MSGCLASS=Q,MSGLEVEL=(1,1),CLASS=C //COMPILE1 EXEC PGM=IGYCRCTL, PARM=’XREF,APO,ADV,MAP,LIST),REGION=0M //STEPLIB DD DSN=SYS1.COB2LIB,DISP=SHR //SYSIN DD DSN=SMSXL86.TEST.COBOL(SAMPGM01),DISP=SHR //SYSLIB DD DSN=SMSXL86.COPYLIB,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSLIN DD DSN=&&LOADSET, DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200), // DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(CYL,(5,10),RLSE), //SYSUT1 DD UNIT=&SYSDA,SPACE=(CYL,(1,10)) => Code SYSUT2 to UT7 //LINKEDT1 EXEC PGM=IEWL,COND=(4,LT) //SYSLIN DD DSN=&&LOADSET, DISP=(OLD,DELETE) //SYSLMOD DD DSN=&&GOSET(SAMPGM01),DISP=(NEW,PASS),UNIT=SYSDA // SPACE=(CYL,1,1,1)) //SYSLIB DD DSN=SMSXL86.LOADLIB,DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,10)) //SYSPRINT DD SYSOUT=* //*** EXECUTE THE PROGRAM *** //EXECUTE1 EXEC PGM=*.LINKEDT1.SYSLMOD,COND=(4,LT),REGION=0M //STEPLIB DD DSN=SMSXL86.LOADLIB,DISP=SHR // DD DSN=SYS1.SCEERUN,DISP=SHR //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=*
Data set structure 數(shù)據(jù)集的結(jié)構(gòu) Working with data sets requires an understanding of the physical and logical structure of a data set, and how z/OS® accesses information in the data set. 使用數(shù)據(jù)集需要我們理解數(shù)據(jù)集的物理和邏輯結(jié)構(gòu)和Z/OS如果訪問這些數(shù)據(jù)集的信息. Data set In z/OS, a data set is a named collection of related data records that is stored and retrieved by an assigned name. A data set is equivalent to a file in other operating systems. Data sets are stored on tape or disks. 數(shù)據(jù)集 在Z/OS中,數(shù)據(jù)集是一個已命名的內(nèi)容相關(guān)數(shù)據(jù)記錄的集合,系統(tǒng)通過這個名字保存和訪問這些數(shù)據(jù)記錄.數(shù)據(jù)集相當(dāng)于其他操作系統(tǒng)里面的文件.數(shù)據(jù)集是存儲在磁盤或者是磁帶里面的. Direct Access Storage Device (DASD) DASD is another name for a disk drive. Additional synonyms include: disk volume, disk pack, or Head Disk Assembly (HDA). (DASD)直接訪問存儲器 DASD 是磁盤設(shè)備的別名,它還有其他的同義詞disk volume, disk pack, or Head Disk Assembly (HDA). Space Disk space is allocated in units called cylinders, tracks, or blocks. 磁盤空間 磁盤空間以柱面,磁道,或者塊為單位作分配. Cylinder A disk drive contains cylinders. A cylinder is a unit of storage on a count-key-data (CKD) device with a fixed number of tracks. 柱面 磁盤包含柱面,一個柱面是一個(CKD)設(shè)備上一個存儲單位,指向一個固定號碼的磁道. Track Cylinders contain tracks, which are circular paths on the surface of a disk or diskette on which information is magnetically recorded and from which recorded information is read. Tracks are in count-key-data (CKD) format, which means that each track contains fields that indicate the start of the track and the space used, followed by records containing three fields: • The count field defines the length of the record • The key field contains optional accounting information • The data field contains the user data 磁道 柱面包含磁道,它是磁盤表面的環(huán)形軌道,以磁性物質(zhì)保存和被訪問數(shù)據(jù)信息. 磁道使用(CKD)格式,意味著每一個磁道包含一系列的字段,這些字段指明了磁道的開始位置和所用的空間,后面跟隨著數(shù)據(jù)記錄,數(shù)據(jù)記錄內(nèi)保存三個字段, .記數(shù)字段包含了記錄的長度 .關(guān)鍵字字段包含了可選的帳戶信息 .數(shù)據(jù)字段包含了用戶的實際數(shù)據(jù) Count Key Data(CKD)是一種磁盤數(shù)據(jù)結(jié)構(gòu)。每條物理磁盤記錄包含一個count區(qū),一個可選的key,以及在一個記錄內(nèi)間隔后面的數(shù)據(jù)data記錄。這個結(jié)構(gòu)后面的原理就是:即然數(shù)據(jù)記錄的長度可能不同,它們就需要有一個統(tǒng)計字段來指示key和物理記錄的長度。統(tǒng)計區(qū)有以柱面頭記錄格式記錄的物理位置標(biāo)識,Key的長度,和數(shù)據(jù)記錄的長度。Key要么沒有,要么是一串字符。大多數(shù)情況下是沒有key的,記錄順序排列,或者以直接柱面頭記錄定位。如果有key,則它通常是數(shù)據(jù)記錄前幾個字節(jié)的拷貝,但它可以是用來找到這條記錄的任何數(shù)據(jù)。這個key(還有記錄)都是通過硬件命令來定位的。Count Key Data Achitecture是由IBM在20世紀(jì)60年代創(chuàng)建的,用來作為System/360的磁盤驅(qū)動,也叫固定塊架構(gòu)(Fixed Block Achitecture。 Record 記錄 Tracks contain records. A record is some number of bytes containing data. The record is the basic unit of information used by a program running on z/OS. 磁道包含記錄,一個記錄是一些包含了數(shù)據(jù)的字節(jié).記錄是Z/OS上應(yīng)用程序處理數(shù)據(jù)的基本單位. • Records have a logical record length (abbreviated as LRECL); different types of DASD impose different maximum lengths for records. • Records are either fixed length or variable length in a given data set. Traditional z/OS data sets have one of five record formats (abbreviated as RECFM): Fixed (F), fixed blocked (FB), variable (V), variable blocked (VB), or undefined (U). .記錄有一個邏輯記錄長度(LRECL)屬性,不同的DASD設(shè)備決定了數(shù)據(jù)記錄的最大長度的不同 .記錄可是定長的,也可以是變長的,傳統(tǒng)上,z/OS有5種記錄格式(RECFM),F固定,FB固定,分塊,V變長,VB變長,分塊,U未知 Blocks Records can be grouped into data blocks, which are the units of recording on disk. Blocking makes processing more efficient because z/OS can access an entire block at once instead of reading or writing records individually. Block size (abbreviated as BLKSIZE) is the physical block size written on the disk for fixed (F) and fixed block (FB) records. For variable and undefined (V, VB, and U) records, block size is the maximum physical block size that can be used for the data set. 塊 數(shù)據(jù)記錄群組成為數(shù)據(jù)塊,是寫入和讀取磁盤的單位.分塊的方式使數(shù)據(jù)處理更加高效,因為z/OS可以用一個塊的單位來讀寫記錄,而不是一個一個記錄單獨來讀寫. 塊大小(BLKSIZE),是指以F(固定)和FB(固定,分塊)格式的數(shù)據(jù)記錄寫入磁盤的塊的大小,對于分塊,V變長,VB變長,分塊,U格式的數(shù)據(jù)記錄,塊大小是數(shù)據(jù)集最大的可用數(shù)據(jù)物理塊大小. Extents 擴(kuò)展 Space for a disk data set is assigned in primary and secondary extents. An extent is a contiguous number of disk drive tracks, cylinders, or blocks. Data sets can increase in extents as they grow. As with blocking, the use of extents is more efficient because reading or writing contiguous tracks is faster than reading or writing data that is scattered over the disk. 磁盤空間分配對于數(shù)據(jù)集來說包括(primary)第一次分配和二次(secondary)擴(kuò)展,一個擴(kuò)展分配了一定數(shù)量連續(xù)的磁盤磁道,柱面,或者塊.基于塊的讀寫方式下,使用磁盤擴(kuò)展數(shù)據(jù)更加高效,應(yīng)為讀寫連續(xù)的磁道是比讀寫零碎的數(shù)據(jù)快速很多. Volume 卷 The term volume is often used to refer to a disk. 卷經(jīng)常被認(rèn)為是磁盤 Volume serial 卷名 The six-character name of a disk or tape volume, such as TEST01. 是磁盤或者磁帶的名字,6個字符,例如test01 Device type 設(shè)備類型 A model or type of disk device, such as 3390. 磁盤設(shè)備的型號或者是類型,例如3390 Organization 組織方式 The method of processing a data set, such as sequential. 處理數(shù)據(jù)的方式,例如順序訪問
//IBMUSERA JOB 168,'ERIC KONG',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=IBMUSER //CRTFILEA EXEC PGM=IEFBR14 //CRTFIL1 DD DSN=IBMUSER.TEST.DATAPF5, // DISP=(NEW,CATLG), // UNIT=SYSDA, // SPACE=(TRK,(10,5),RLSE), // DCB=(RECFM=FB,LRECL=208,BLKSIZE=208)
//IBMUSERA JOB 168,'ERIC KONG',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=IBMUSER //CRTFILEA EXEC PGM=IEFBR14 //CRTFIL1 DD DSN=IBMUSER.TEST.DATAPF3, // DISP=(MOD,DELETE), // SPACE=(TRK,(0,0))
//IBMUSERK JOB 168,'ERIC KONG',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=IBMUSER //CPSTEP EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=IBMUSER.TEST.DATAPF2,DISP=SHR //SYSUT2 DD DSN=IBMUSER.TEST.DATAPF2B,DISP=(,CATLG,DELETE), // SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,LRECL=208,BLKSIZE=2080),UNIT=SYSDA //SYSIN DD DUMMY //
//IBMUSERC JOB 'COMP BATCH',CLASS=A,MSGCLASS=H, // NOTIFY=IBMUSER,MSGLEVEL=(1,1) //*************** DEFINE A PROC START ******************************* //CBLBATCH PROC //********************************************************************* // SET SRC=&SRC //********************************************************************* //* JOB TO COMPILE AND LINK-EDIT COBOL PROGRAM //********************************************************************* //*************** COMPILE STEP *************************************** //COBOL EXEC PGM=IGYCRCTL,REGION=2048K, // PARM='NODYNAM,LIB,OBJECT,RENT,RES,APOST,MAP,XREF,OFFSET' //STEPLIB DD DSNAME=IGY410.SIGYCOMP, // DISP=SHR //SYSPRINT DD SYSOUT=* //SYSLIN DD DSNAME=&&LOADSET,UNIT=SYSDA, // DISP=(MOD,PASS),SPACE=(TRK,(3,3)), // DCB=(BLKSIZE=3200) //SYSIN DD DSN=IBMUSER.TEST.COBOL(&SRC),DISP=SHR //SYSLIB DD DSN=IBMUSER.TEST.COPY,DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1)) //****************** LINK STEP ***************************************** //LKED EXEC PGM=HEWL,COND=(8,LT,COBOL),REGION=1024K, // PARM='LIST,XREF' //SYSLIB DD DSNAME=CEE.SCEELKED,DISP=SHR // DD DSN=IBMUSER.TEST.LOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSLIN DD DSNAME=&&LOADSET,DISP=(OLD,DELETE) //SYSLMOD DD DSNAME=IBMUSER.TEST.LOAD(&SRC),DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10)) //********************************************************************** //* DEFINE A PROC COMPLETE //********************************************************************** // PEND //********* RUN THE PROC TO COMPILE COBOL RESOURCE ******************* //RUNAPP1 EXEC CBLBATCH,SRC=HELLO //*************** RUN THE PROGRAM ************************************** //STEPRUN EXEC PGM=HELLO //STEPLIB DD DSN=IBMUSER.TEST.LOAD(HELLO),DISP=SHR //SYSOUT DD SYSOUT=* //
|