You are on page 1of 9

IMPORTANT TERMS IN COBOL EJECT :-

The EJECT statement is a compiler-directing statement which causes the compiler to perform a page eject operation on the source listing. The next source statement line (i.e., the line following the EJECT statement) is then printed at the top of the next page. Format ----------EJECT EJECT may appear in either Area A or Area B but must be the only statement on the line. It may be followed by an optional period. The EJECT statement may be used in order to force the placement of the beginning of the next section of a source program (i.e., the next record description, the next processing routine or paragraph, etc.) at the top of a new page within the source listing. This makes the source program more "readable". The EJECT statement itself is never printed. It has no effect on the object code generated by the compiler.
SKIP:-

The SKIP statement is a compiler-directing statement, provided as an IBM extension, which causes blank lines to be inserted in the source program listing. Format -----SKIP1/SKIP2/SKIP3 SKIP1 causes a single blank line to be inserted in the source program listing. SKIP2 causes two blank lines to be inserted in the source program listing. SKIP3 causes three blank lines to be inserted in the source program listing. The SKIP statement may appear anywhere in Area A or Area B but must be the only statement on the line. It may be terminated by a separator period. The SKIP statement itself is never printed. It has no effect on the object code generated by the compiler

JCL CLASS PARAMETER DETAILS ADHOC (Risk, Marketing, Collections, etc.) DEFINITION This class is for batch jobs requiring 4 or more tape drives. No time parameter is required. DO NOT SUBMIT JOBS IN THIS CLASS UNLESS YOU REQUIRE 4 OR more TAPE DRIVES. S This class is for batch jobs requiring tape drives. No time parameter is required. This class is for jobs that require 3 or LESS tape drives. DO NOT SUBMIT JOBS IN THIS CLASS UNLESS YOU REQUIRE 3 OR LESS TAPE DRIVES. T Only jobs requiring less than 30 seconds of CPU time and NO tape drives are permitted in this class. TIME parameter is required on the job card. TIME=(,30). U This class is for jobs using up to 3 tape drives, and 60 CPU seconds. Time parameter is required. TIME=1. W This is the overnight job class for delayed processing. DEVELOPMENT (RFSIS Development Staff, Systems Software ) A This is the quick turnaround class. Only jobs requiring 5 Seconds or less of CPU time. No tape drives are permitted. TIME=(,5) parameter on the JOB card is required. Q Only jobs requiring less than 30 seconds of CPU time and no tape drives are permitted in this class. TIME parameter is required on the job card. TIME=(,30). 1 This class is for jobs using up to 3 tape drives, and 60 CPU seconds. Time parameter is required. TIME=1. X This class is for jobs using more than 1 minute of CPU time and/or more than 3 tape drives. Jobs in this class will be run at the operator's discretion depending upon system load. W This is the overnight job class for development processing Z This class is for jobs using more than 1 minute of CPU time and no tape drives. Any jobs executing in this class allocating tape drives will be cancelled by operations. PRODUCTION (Production control, Computer Operations, System Software only) B Reserved for production jobs. (Jobs submitted by CA7.) D Reserved for production jobs. (Jobs submitted by CA7.) C Reserved for special CICS/IDMS batch jobs. 7 Reserved for CA7. 8 Reserved for CICS and IDMS journals. 9 Reserved for APC. P Reserved

CLASS R

HRECALL :HDELETE :-.

To recall files which are migrated.

The HDELETE command is used to delete one or more migrated data sets from migration volumes. DFSMShsm deletes the data set without recalling it to a primary volume. When DFSMShsm deletes the data set, it maintains any backup versions of the data set.

HRECOVER :Recover a data set from a backup version or restore a data set from a dump copy

1) To Block Purge Jobs in Q:ST : Use // at the beginning of the block and put //P at the end of the block.

The jobs within the block will be purged. 2) To get information about the JOBS which are in EXECUTION Go to Q;ST, type DA at Command Line. The Display Active Users (DA) panel allows authorized users to display information about jobs, users, started tasks, and initiators that are active on the system. 3) OWNER : Limit jobs displayed by owning user ID. Format: OWNER (ownerid|?) Examples: OWNER CPI377 (with no other filtering in effect) Displays only jobs for that owner. OWNER * (with no other filtering in effect) Display user information :- Command is 'WHO' Purpose:, Displays the following information about the User: User ID, TSO logon procedure, terminal identification, and index number and name of the group in ISFPARMS. Also shows the levels of MVS, JES, ISPF, RMF and SDSF; the JES name, the SDSF server name and whether the server is in use.
share options (cr-value cs-value) values: 1 multiple read or single write 2 multiple read and single write 3 multiple read and multiple write cr value: specifies value for cross region sharing. cross region sharing is defined as different jobs running on the same system using global resource serialization,a resource control facility. cs value: specifies the value for cross system sharing means different jobs running on different system in a nongrs environment.

4)

Instead of using JCL to perform SORT operation , there's one simple alternative, For eg:- Open a Flat file in edit mode. On the command line type (say) SORT 1,7 and press ENTER, the file will be sorted on positions 1 to 7 bytes.

COMPAREX

Similar to option 3.13 , i.e. compares two files. COMPAREX allows you to restrict the compare to certain fields within each record, or to ignore certain fields. FIELDs are used to specify which fields are to be compared. MASKS,are used to specify which fields are NOT to be compared. For example:
F=FIELD M=MASK f f m --------FIELD ONE--------DISPLACEMENT LENGTH FORMAT 5 106 111 4 p 33 7 z ----FIELD TWO--------DISP LEN FORMAT 112 3 b

Generates: FIELD=(5,106,C) FIELD1=(111,4,P) FIELD2=(112,3,B) MASK=(33,7,Z)

For example: //JS30 EXEC //SYSPRINT DD //SYSUT1 DD // //SYSUT2 DD // //SYSIN DD FORMAT=13 /* PGM=COMPAREX SYSOUT=* DISP=SHR, DSN=TCEX.Q133P020.F02A.PREMOUT DISP=SHR, DSN=TCEX.Q133P020.F02A.PREMOUT.TEST *

COMPAREX USING MASK COMMAND i.e. //SYSIN DD * FORMAT=13 MASK=(271,20,C)

where MASK=( Position, Length and Type)


For example MASK=(271,20,C) means, Do NOT compare the data from position 271 + 20 Characters (C stands for characters).

And where Format equals :FORMAT - xy specifies DATA formatting characteristics in how differences are displayed. Two numerics x and y where x equals X 0 1 2 & where y equals Y 1 2 3 4 5 6 Equals full display of SYSUT1 followed by full SYSUT2 full display of SYSUT1 followed by differing lines of SYSUT2 differing lines of SYSUT1 followed by differing lines of SYSUT2 full display of SYSUT1 interleaved with full display of SYSUT2 full display of SYSUT1 interleaved with differing lines of SYSUT2 differing lines of SYSUT1 interleaved with differing lines of SYSUT2 Equals 0-dump format alphanumeric line DITTO format (vertical hex)

Note :See that I have used Format = 13 in the above example

145.What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? (applicable to only MVS/ESA). A. These are compile/link edit options. AMODE - Addressing mode. RMODE - Residency mode. AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing. AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only). RMODE(ANY) - Can reside above or below 16 Meg line.

148.How do you set a return code to the JCL from a COBOL program? A. Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

149.How can you submit a job from COBOL programs? A. Write JCL cards to a dataset with 150.What are the differences between OS VS COBOL and VS COBOL II?

OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run
either in 24 bit or 31 bit addressing modes allowing program to address above 16 Meg main storage line.

Report writer is supported only in OS/VS Cobol. USAGE IS POINTER is supported only in VS COBOL II. Reference modification eg: WS-VAR(1:2) is supported only in VS COBOL II.

COBOL II introduces new features (EVALUATE, SET ... TO TRUE, CALL ... BY CONTEXT, etc) Scope terminators are supported in COBOL II. OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds. Under CICS Calls between VS COBOL II programs are supported. COBOL II supports structured programming by using in-line PERFORM 's.

COBOL II does not support old features (READY TRACE, REPORT-WRITER, ISAM, etc.).

In non-CICS environment, it is possible. In CICS, this is not possible


Ans we to bala s bandlas question what happens when we move a comp-3 field to an edited ( say z(9).zz-) Answer: the edititing characters r to be used with data items with usage clause as display which is the default.when u try displaying a data item with usage as computational it does not give the desired display format becoz the data item is stored as packed decimal.So if u want this particular data item to be edited u have to move it into a data item whose usage is diplay and then have that particular data item edited in the format desired. What is the difference between a subscript and an index?

A subscript is an occurrence value. An index is adisplacement value. For example if you have a list of month nameseach occupying 9 bytes, then the value of a subscript for the month of May would be 5, but the index would be 36. A formula to calculateindex value when the occurrence and item length are known is:Index-Value = (Occurrence -1) * Item-Length

What is the limit of working storage and linkage section limit? (IQ 34) Working storage and Linkage section limit of COBOL85 is 128MB (COBOL741MB) 77,01-49 level item limit in COBOL85 is 16MB (COBOL74-1MB) How to swap the values of two variables without an intermediate variable?(IQ 33) Let the variables be A and B Way 1:COMPUTE A = A+B Way 2: COMPUTE A=A*B COMPUTE B = A-B COMPUTE B=A/B COMPUTE A = A-B COMPUTE A=A/B I have retrieved a value from DB2 VARCHAR column. (Ex: WS-VAR = muthu$sara$ $ is 1-n spaces.) How to get the length of the WS-VAR in COBOL program? I should not count right hand spaces. (IQ 20) LENGTH function counts space also as a character. So we cannot use that function for our purpose. INSPECT is also not useful as the string may contain 1- n spaces in between and that needs to be counted. So the logic would be Read from right until you read first noon-space character. PERFORM VARYING WS-SUB-NAME FROM LENGTH OF WS-VAR BY -1 UNTIL END-FOUND OR WS-SUB-NAME = 0 IF WS-NAME-CHK(WS-SUB-NAME:1) NOT EQUAL TO SPACE MOVE 'Y' TO WS-END-OF-FIELD DISPLAY 'LENGTH ' WS-SUB-NAME END-IF END-PERFORM How to pass user return code and user ABEND from the COBOL program to the JCL? RETURN-CODE is a special register and its content is moved to register15 when the control is given back to OS. So move the return code to this register in the program. Ex: MOVE 1000 to RETURN-CODE. This sets return code as 1000 for the step that executes this program. For ABEND, you should call your installation specific assembler routine or ILBOABN0 with the ABEND code you want. CALL ILBOABN0 USING WS-AB-CODE. WS-ABEND-CODE is the variable that has ABEND-CODE. It is a half word binary. What should be the LRECL of printer files? Use 133 character records in your program and set the print control character yourself. In this case your JCL would have RECFM=FB, LRECL=133 Use 132 character records in the program and have WRITE ....ADVANCING put in the print control. You need the compiler option ADV for this and the JCL would have RECFM=FBA,LRECL=133......... What are the sort algorithms? (IQ 17 and 28) Mainframe Refresher Part-1 COBOL-Page: 38 Bubble Sort: Consecutive elements are compared and keys of two elements are not in proper order, they are swapped. In the first pass, the key with largest value will be

moved to the last position and n-1 passes needed to sort the whole table. In between, if any pass results no interchange it implies that the table is in sorted order. Array: 1 20 9 50 8 First Pass: (Maximum 4 comparisons for 5 elements) 1, 20->no change, 20 & 9 -> 20 is great so swap (1 9 20 50), 20 & 50 -> no change, 50 & 8 -> 50 is great, so swap. (1 9 20 8 50) Second Pass: (1 9 20 8 50) - (Maximum 3 comparison for 5 elements) 1 & 9-> no change, 9 & 20 -> no change, 20 & 8 -> 20 is great so swap (1 9 8 20 50) Third Pass: (1 9 8 20 50) (Maximum 2 comparisons for 5 elements) 1 & 9 -> no change, 9 & 8-> change (1 8 9 20 50) Fourth Pass: (1 8 9 20 50) (Maximum 1 comparison for 5 elements) 1 & 9 -> no change Note: You can come out of sort when you find no change in all the comparisons of a pass. Shuttle Sort: In the first pass only first two elements are compared and sorted and in the second pass, third element is compared with two and one and it is placed in the right position. In the ith pass, it assumes that I elements are in already sorted order, proceeds to sort the first (I+1) elements by comparing I+1 th element with I, and I with I-1 and so on until top of the table is reached or no-exchange in a comparison. Array: 1 20 9 50 8 First Pass: Two elements (1 20) - Maximum 1 comparison 1, 20->no change Second Pass: Three elements (1 20 9) Maximum 2 comparisons 9 & 20 -> change (1 9 20) 9 & 1 -> no change Third Pass: Four elements (1 9 20 50) Maximum 3 comparisons 50 & 20 -> no change and stop (no need for any other comparison) Fourth Pass: Five elements (1 9 20 50 8) Maximum 4 comparisons 8 & 50 -> change ( 1 9 20 8 50) , 8 & 20-> Change ( 1 9 8 20 50) 8 & 9 -> Change (1 8 9 20 50) , 8 & 1 -> no change and stop. Note: You can come out of pass if you find one no change Shuttle sort is better than bubble sort for sorting arrays with more than 10 elements. COMP-3 items are always better than COMP with respect to memory usage (IQ 21)? No. COMP items occupy less space than COMP-3 items at boundaries. PIC S9(04) COMP occupies 2 bytes whereas PIC S9(04) COMP-3 occupies 3 bytes. PIC S9(09) COMP occupies 4 bytes whereas PIC S9(09) COMP-3 occupies 5 bytes. PIC S9(18) COMP occupies 8 bytes whereas PIC S9(18) COMP-3 occupies 10 bytes. I have a KSDS Students file with 4 bytes key. First two-bytes contain class number and next two-bytes contain student number. I want to read all the students in class 02. How will you do that? Mainframe Refresher Part-1 COBOL-Page: 39 Allocate the file with dynamic access mode. Move 02 to first two-bytes of the key and low-values to next two-bytes of the key. You can do these moves by reference modification operator or de-grouping the four-byte field into two two-byte fields in the file section. Issue the START command with KEY IS GREATER THAN clause. Start reading Topic: JCL Question: How do you submit JCL via a Cobol program? For the above question the solution is as follows.. Answer: In your JCL define as//JOBA JOB 1111,JOB1//STEP01 EXEC PGM=PROG1//ddname DD SYSOUT=(*, INTRDR).... And your COBOL (PROG1) should look like thisSELECT JCL-FILE ASSIGN TO ddname. Open this file and write the JCL statements into this file.Example.MOVE '//TESTJOB JOB 1111,VISVEISH' TO

JCL-REC.MOVE '//STEP01 EXEC PGM=IEFBR14' TO JCL-REC.and close this file. Then TESTJOB will be submitted. Topic: JCL Question: How do you submit a JCL under CICS environment? Answer: pass all the JCL codes to a COBOL variable (should be declare using OCCURS clause) and the write the line one by one to the spool using CICS commands like SPOOLClose SPOOLOpen SPOOLWrite . For more help refer CECI of CICS or CICS manual

You might also like