Mainframe refresher by muthu pdf free download






















Changes all 'Musa' as 'Muthu'. Note: Change Mainframe Refresher Part Extent is contiguous memory location. Only 16 extents are FREE shipping on qualifying offers. Mainframe Refresher Part Download Mainframe-Refresher-Part First Book in mainframe that comes with short and sufficientcov Be the first to ask a question about Mainframe Refresher Part Apr 20, Mainframe Refresher.

Mainframe Refresher 1. First two are almost similar , Last one from mainframegurukul covers most of the jcl concepts and helps better than first It will be explained later. Input-Output Section. Files used in the program are identified in this paragraph. It specifies when check points to be taken and storage areas that are shared by different files. Data division is used to define the data that need to be accessed by the program.

It has three sections. Literals, Constants, Identifier, 1. Literal is a constant and it can be numeric or non-numeric. Numeric literal can hold 18 digits and non-numeric literal can hold characters in it. COBOL74 supports characters only 3. Literal stored in a named memory location is called as variable or identifier. MUSA is a non-numeric literal. WS-VAR1 is a identifier or variable. It can take a value from the set of integers between or from one of the special level-numbers 66 77 88 01 level.

Specifies the record itself. It may be either a group item or an Elementary item. It must begin in Area A. Specify group or elementary items within a record. Group level items must not have picture clause. Identify independent data item. Condition names. Variable name and Qualifier Variable name can have characters with at least one alphabet in it.

Hyphen is the only allowed special character but it cannot be first or last letter of the name. Name should be unique within the record. If two variables with same name are there, then use OF qualifier of high level grouping to refer a variable uniquely. Numeric Numeric Edited. Ex: Japanese language applications. Refreshing Basics Nibble. In packed decimal, each nibble stores one digit. By default, every character is stored in one byte. Half word.

MVS Full word. MVS Double word. Number of bytes required equals to the size of the data item. COMP Binary representation of data item. PIC clause can contain S and 9 only. S9 01 S9 04 Half word. S9 05 S9 09 Full word. S9 10 - S9 18 Double word. Most significant bit is ON if the number is negative. COMP-1 Single word floating point item.

PIC Clause should not be specified. COMP-2 Double word floating-point item. Two digits are stored in each byte. Last nibble is for sign. Value of item must not exceed picture size. It cannot be specified for the items whose size is variable. It is applicable when the picture string contain S. So S doesnt take any space. It is stored along with last digit. SYNC clause does this but it may introduce slack bytes unused bytes before the binary item.

WS-VAR2 is expected to start at second byte. As the comp item in the example needs one word and it is coded with SYNC clause, it will start only at the next word boundary that is 4th byte. Redefining declaration should immediately follow the redefined item and should be done at the same level.

Multiple redefinitions are possible. Size of redefined and redefining need not be the same. It should be declared at 66 level. It need not immediately follows the data item, which is being renamed. A condition name specifies the value that a field can contain and used as abbreviation in condition checking. It cannot be used with 66 and 88 level items. Detail explanation is given in Table Handling section. Linkage section MUST be coded with a half word binary field, prior to actual field.

If length field is not coded, the first two bytes of the field coded in the linkage section will be filled with length and so there are chances of 2 bytes data truncation in the actual field. This is the last division and business logic is coded here. It has user-defined sections and paragraphs.

Section name should be unique within the program and paragraph name should be unique within the section. Procedure division statements are broadly classified into following categories. Meaning Direct the program to take a specific action. MOVE Statement It is used to transfer data between internal storage areas defined in either file section or working storage section. Numeric move rules: A numeric or numeric-edited item receives data in such a way that the decimal point is aligned first and then filling of the receiving field takes place.

Unfilled positions are filled with zero. Zero suppression or insertion of editing symbols takes places according to the rules of editing pictures.

Alphanumeric Move Rules: Alphabetic, alphanumeric or alphanumeric-edited data field receives the data from left to right. Any unfilled field of the receiving filed is filled with spaces. When the length of receiving field is shorter than that of sending field, then receiving field accepts characters from left to right until it is filled.

The unaccomodated characters on the right of the sending field are truncated. When an alphanumeric field is moved to a numeric or numeric-edited field, the item is moved as if it were in an unsigned numeric integer mode.

Group Move rule When MOVE statement is used to move information at group level, the movement of data takes place as if both sending and receiving fields are specified as alphanumeric items.

This is regardless of the description of the elementary items constituting the group item. Value of B after Move To retain the values of operands participating in the operation. The resultant value of operation exceeds any of the operand size. It is usually coded after the field to be rounded. We can use arithmetic symbols than keywords and so it is simple and easy to code.

Rule: Left to right 1. Parentheses 2. Exponentiation 3. Multiplication and Division 4. All arithmetic operators have their own explicit scope terminators. It is suggested to use them. It returns control back to OS. It returns control back to main program. It just gives the control back from where it received the control. Collating Sequence There are two famous Collating Sequence available in computers. The result of arithmetic and alphabetic comparison would be same in both collating sequences whereas the same is not true for alphanumeric comparison.

THEN is a noise word and it is optional. This rule can be overridden by using parentheses. If you forgot the difference between statement and sentence, refer the first page.

Implied operand: In compound conditions, it is not always necessary to specify both operands for each condition. It can be used in the following way.

Any simple, relational, class, sign test can be negated using NOT. Example ZERO. Any complex condition can be given in the WHEN clause. Break statement is not needed, as it is so in other languages. Statement1 Statement2. It executes all the instructions coded in PARA-1 and then transfers the control to the next instruction in sequence.

This is equal to DO.. END structure of other languages. The identifiers used in the UNTIL condition s must be altered within the paragraph s being performed; otherwise the paragraphs will be performed indefinitely. If the condition in the UNTIL clause is met at first time of execution, then named paragraph s will not be executed at all. N can be literal defined as numeric item in working storage or hard coded constant. If the condition is again false, repeat this process till the condition is satisfied.

EXIT statement. It is used as a single statement in a paragraph that indicate the end of paragraph s execution. The readability of the program will also be badly affected. But still GO TO can be used within the paragraphs being performed. It can be defined as elementary or group item.

Initialization of large table occurrences with specific values are usually done using perform loops in procedure division. Simple tables can be initialized in the following way. Dynamic array is the array whose size is decided during runtime just before the access of first element of the array.

It can be used in any arithmetic operations or for display. Subscripts can be modified by any arithmetic statement. Index Internal Item No need to declare it. It means displacement Faster and efficient. It cannot be used for arithmetic operation or for display purpose. Sometimes, you may face a question like how to randomly access the information in the sequential file of 50 records that contains all the designation and the respective lower and higher salary information.

Obviously, OS does not allow you to randomly access the sequence file. You have to do by yourself and the best way is, load the file into a working storage table in the first section of the program and then access as you wish.

The table look-up can be done in two ways. If the condition is met, the table look-up is completed. If the condition is not met, then index or subscript is incremented by one and the next entry is searched and the process continues until a match is found or the table has been completely searched. SET indexname-1 TO 1. Condition-1, Condition-2 compares an input field or search argument with a table argument.

Identifier-2 and identifier-3 are subscripted items and dataname-1 and dataname-2 are working storage items that are not subscripted. Compare the item to be searched with the item at the center. If it matches fine, else repeat the process with the left or right half depending on where the item lies.

Only one WHEN condition can be coded. Only AND is possible in compound conditions. Prefer when the table size is significantly large. Expanded nested perform is available for processing multi level tables.

The contained program s may themselves contain yet other program s. If you want to manipulate the data before feeding to sort, prefer internal sort. In all other cases, external sort is the good choice. Internal sort, in turn invokes the SORT product of your installation. In the run JCL, allocate at least three sort work files.

It would significantly improve the performance. If the sort is successful, the value will be 0 else It should not be explicitly opened or closed. If we intend to eliminate more records, then it would be better preprocess them before feeding to SORT. If we want to eliminate all the records having spaces in the key field then it would be efficient if we eliminate them after sorting.

Because the records with blank key comes first after sorting. It is same as sort. USING is mandatory. Main String is identifier-1 and count is stored in identifier Literal-1 or Identifier-3 is a character or group-of-characters you are looking in the main-string. Common routines like error routine, date validation routine are coded in a library and bring into the program by COPY.

Master files are used in multiple programs. Their layout can be placed in one copybook and be placed wherever the files are used. It promotes program standardization since all the programs share the same layout and the same data names.

This reduces coding and debugging time. Change in layout needs change in copybook only. It is enough if we just recompile the program for making the new copy effective. Copybooks can be used in the following paragraphs. If the same copybook is used more than once in the program, then there will be duplicate data declaration error during compilation, as all the fields are declared twice.

The replacing option does not alter the prewritten entries in the library; the changes are made to the users source program only. CALL statement Sub-Programs When a specific functionality need to be performed in more than one program, it is best to write them separately and call them into each program. Sub Programs can be written in any programming language. They are typically written in a language best suited to the specific task required and thus provide greater flexibility.

PGM2 is called here. WS-VAR1 is passed by reference. As we have already mentioned, the linkage section is used for accessing external elements. As these working storage items are owned by main program, to access them in the sub-program, we need to define them in the linkage section. In addition to define them in linkage section, the procedure division should be coded with these data items for address-ability.

This returns the control back to main program. If the sub program is modified then it needs to be recompiled. The need for main program recompilation is decided by the compiler option used for the main program.

The modified subroutine will be in effect during the run. Difference between Pass-by-reference and Pass-by-content Sl 1 2 3 4. Value of WS-VAR1 is passed The sub-program modifications on the passed elements are local to that sub-program and not visible in the main program. If the subprogram undergoes change, sub program and main program need to be recompiled. Sub modules are link edited with main module. Size of load module will be large Fast Less flexible. By default, call variables and any unresolved calls are considered as dynamic.

If the subprogram undergoes change, recompilation of subprogram is enough. Sub modules are picked up during run time from the load library. Size of load module will be less. Slow compared to Static call. More flexible. Program will be in initial state every time it is called.

Returns the length of the PIC clause. Used for finding length of group item that spanned across multiple levels. Returns the content of the argument that contains the maximum value Returns the content of the argument that contains the minimum value Returns the numeric value represented by an alphanumeric character string specified in the argument.

Gregorian date for the integer passed. Julian date for the integer passed. Steps in file-handing 1. The file is allocated to your program by this statement. The mode of OPEN decides the operation allowed and the initial pointer in the dataset.

Close: After the processing, close the file to disconnect it from the program. If not, an execution error will occur. The file can also be dynamically allocated instead of static allocation in JCL. Default is Sequential. It is default access mode and it is used to access the records ONLY in sequential order. To read th record, first 99 records need to be read and skipped. It is mixed access mode where the file can be accessed in random as well as sequential mode in the program. Example: Reading the details of all the employees between



0コメント

  • 1000 / 1000