cobol mainframe mania

53
1) What is the maximum value that can be stored in S9(8) COMP? Article Number: 10018 | Last Updated: Sat, Nov 28, 2009 at 9:02 AM 99999999 2) Can I redefine an X(200) field with a field of X(100) ? Article Number: 10006 | Last Updated: Sat, Nov 28, 2009 at 8:35 AM Yes 3) How many bytes does a S9(7) COMP-3 field occupy ? Article Number: 10014 | Last Updated: Sat, Nov 28, 2009 at 9:00 AM Will take 4 bytes. Sign is stored as hex value in the last nibble. General formula is INT((n/2) + 1)), where n=7 in this example. 4) What are the two cobol verbs that are used in data division? (one is COPY..what is the other) Article Number: 9744 | Last Updated: Sat, Nov 28, 2009 at 2:11 AM

Upload: rupesh-kumar

Post on 08-Apr-2015

349 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Cobol Mainframe Mania

1) What is the maximum value that can be stored in S9(8) COMP?Article Number: 10018 | Last Updated: Sat, Nov 28, 2009 at 9:02 AM 99999999

2) Can I redefine an X(200) field with a field of X(100) ?Article Number: 10006 | Last Updated: Sat, Nov 28, 2009 at 8:35 AM Yes

3) How many bytes does a S9(7) COMP-3 field occupy ?Article Number: 10014 | Last Updated: Sat, Nov 28, 2009 at 9:00 AM Will take 4 bytes. Sign is stored as hex value in the last nibble.General formula is INT((n/2) + 1)), where n=7 in this example.

4) What are the two cobol verbs that are used in data division? (one is COPY..what is the other)Article Number: 9744 | Last Updated: Sat, Nov 28, 2009 at 2:11 AM CALL is the statement used in the Data division

5) How to initialize a group data which is containing occur clause?Article Number: 10044 | Last Updated: Sat, Nov 28, 2009 at 9:50 AM

Page 2: Cobol Mainframe Mania

#.1 . Here is an example for how to initialize the normal group variable .

ex : 01 ws-details .

02 ws-name a(10 ) .

02 ws-desig a(5) .

move spaces to ws-details .

#.2 . If occurs clase exist , here is the example

move all spaces to ws-details .

The only diff is we need put the " all " . Same can be done using perform and repeting loop equal no of occur times .

6) What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands?Article Number: 9959 | Last Updated: Sat, Nov 28, 2009 at 7:53 AM In a binary search the table element key values must be in ascending or descending sequence. The table is ’halved’ to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential.

7) In the JCL, how do you define the files referred to in a subroutine ?

Page 3: Cobol Mainframe Mania

Article Number: 10024 | Last Updated: Sat, Nov 28, 2009 at 9:07 AM Supply the DD cards just as you would for files referred to in the main program.

8) When would you use in-line perform?Article Number: 10002 | Last Updated: Sat, Nov 28, 2009 at 8:32 AM When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.

9) 77 WS-AMT PIC ZZZ999. ADD 100 TO WS-AMT WILL RESULT IN a) COMPILATION ERROR b) SOC7 ERROR C) NO ERRORArticle Number: 9669 | Last Updated: Sat, Nov 28, 2009 at 1:11 AM It will give Compilation Error, because ws-amt is not numeric field so arithmetic operation cannot be possible in ws-amt field

10) In FILE SECTION of a COBOL programme, I have the following line. RECORD VARYING FROM 122 TO 160 DEPENDING ON WS00_RECORD_LENGTH How would the value of WS00_RECORD_LENGTH found out? Where will it be?

Page 4: Cobol Mainframe Mania

Article Number: 10047 | Last Updated: Sat, Nov 28, 2009 at 9:52 AM In this line you have to defined WS00_RECORD_LENGTH as S9(4) comp.

And when you write the statement:

READ FILE-NAME

this variable automatically get the record length in this variable.

11) What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to only MVS/ESA Enterprise Server).Article Number: 10030 | Last Updated: Sat, Nov 28, 2009 at 9:14 AM 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.

12) What is the difference between STOP & STOP RUN ?Article Number: 9714 | Last Updated: Sat, Nov 28, 2009 at 1:40 AM Stop statement provides a means to temporarily suspend execution of an object program...wheares STOP used with RUN causes the entire run unit to cease execution when it is encountered....

13) 1) Is more than one record description is allowed in a FD? 2) Is NUMERIC EDIT fields can

Page 5: Cobol Mainframe Mania

be used for Arithmatic operations? 3) Is COMPUTE P,Q,W = A<plus> B/C -E ** 2 is a valid statement? 4) Is LINKAGE SECTION is mandatory in a sub program? Article Number: 9724 | Last Updated: Sat, Nov 28, 2009 at 6:35 AM 1) YES (In case of variable length records different records of different length must be described in more than one RDs)

(2)NO(never)

(3)NO(commas b/w P Q & w is not allowed)

(4)NO (A command known as EXTERNAL cammand can be used to share variables b/w main & sub prog. in that case linkage section is not required)

(5)don’t remember

(6)8 bytes

(7)normally 18 but by some method that can be extended

14) 77 I PI 9. PERFORM VARYING I FROM 1 BY 1 UNTIL>10 DISPLAY ’OK’ END-PERFORM. What output/msg is likely when this program is executed thru JCL?Article Number: 9672 | Last Updated: Sat, Nov 28, 2009 at 1:12 AM This loop will give compilation error becoz value of I is declared for only one digit , when loop reaches to 10 it will find mismatching b/w I & the current value i.e. 10.

Page 6: Cobol Mainframe Mania

15) what is meant by abbend and what is the difference between abbend and error. when does and why dose it come. what are the types?Article Number: 9680 | Last Updated: Sat, Nov 28, 2009 at 1:21 AM Abend is short for Abnormal end, abend is a term used to describe when a program or task ends without warning. Generally when an abend is encountered the user will receive some type of error message.

Error occurs because of Syntax problems or dataset disposition issues etc, whereas Abend occurs because of some functional problems

Types:SB37 - End of VolumeSE37 - Maximum extents reachedS013 - Member not foundS80A - Region limit violation

16) Can we reverse the string in cobol ? See the following problem : 77 NAME PIC X(10) VALUE ’MANOJ’ 77 SRNAME PIC X(10). I want JONAM in SRNAME.Article Number: 9712 | Last Updated: Sat, Nov 28, 2009 at 1:39 AM we can reverse the string using cobol prog like this :

IDENTIFICATION DIVISION. PROGRAM-ID. MID. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION.

Page 7: Cobol Mainframe Mania

01 STR1 PIC X(7) VALUE IS ’MANOJ’. 01 STR2 PIC X(1). 01 STR3 PIC X(7) VALUE SPACE. *01 STR4 PIC X(7). 01 STRLEN PIC 9(1). 01 CTR1 PIC 9(1) VALUE IS 1. PROCEDURE DIVISION. INSPECT STR1 TALLYING STRLEN FOR CHARACTERS. DISPLAY STRLEN. PERFORM UNTIL STRLEN < 1

MOVE STR1(STRLEN:1) TO STR2 DISPLAY STR2 STRING STR3 DELIMITED BY SPACE STR2 DELIMITED BY SPACE INTO STR3 COMPUTE STRLEN = STRLEN - 1 DISPLAY STR3 END-PERFORM. DISPLAY STR3. STOP RUN. Through cobol intrinsic function REVERSE also we can do it.Identification division.program-id. rev.data division.working-storage section.77 str1 pic x(5).77 revstr pic x(5).procedure division.display "enter string".accept str.move function reverse(str) to revstr.display revstr.stop run.

17) 77 CTR PIC S9(4)V99 VALUE -1234.55. What will be output of the statement DISPLAY CTR?Article Number: 9721 | Last Updated: Sat, Nov 28, 2009 at 1:43 AM CTR will be "12345N" becoz the given value is negative and minus sign will be store in right most digit.

Page 8: Cobol Mainframe Mania

18) What is file status 92?Article Number: 10026 | Last Updated: Sat, Nov 28, 2009 at 9:08 AM Logic error. e.g., a file is opened for input and an attempt is made to write to it.

19) Someone plz. show me paths......... 1) What is the difference between write & move in COBOL.? 2) What is the meaning of ’TALLING’ verb in cobol? 3) What is the meaning of ’Eject’ verb in cobol?Article Number: 10051 | Last Updated: Sat, Nov 28, 2009 at 9:59 AM write means u r inserting records in to a file

move means u r passing data from one variable to another

for exp a=10 b=0

move a to b

now b=10.

write record name

here u r inserting records into file.

talling is to be used for word counting

20) How can we pass data from cobol to JCl?

Page 9: Cobol Mainframe Mania

Article Number: 9691 | Last Updated: Sat, Nov 28, 2009 at 1:28 AM We can pass data from Cobol to JCL through registers of procedure division.

21) Plz tell me how to read/write records form bottom frm a sequential file in cobol?Article Number: 9729 | Last Updated: Sat, Nov 28, 2009 at 1:53 AM You can define the file as

READ <FILE-NAME> PRIOR RECORD.

had this been next record, you could have written

READ <FILE-NAME> NEXT RECORD.

22) What is the difference between CONTINUE & NEXT SENTENCE ?Article Number: 10041 | Last Updated: Sat, Nov 28, 2009 at 9:45 AM CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence

23) What are the type of comp usage?Article Number: 9740 | Last Updated: Sat, Nov 28, 2009 at 2:07 AM COMP Usage is used for data items of numeric type. There are 4 types of COMP usage. 1.COMP : Used only for integers.Either half word or full word . 2.COMP -1 :Used for floating points.Internal representation is hexa decimal.full word is used.No PIC Clause . 3.COMP -2 : Similar to COMP-1.Only difference is double word(8 bytes )is used 4.COMP -3 :Interenal representation is decimal.Each character is

Page 10: Cobol Mainframe Mania

assinged to half byte.The sign bit is assinged to right most bit. The no.of bytes required for n characters is (n/2) + 1 (rounding down)

24) How many bytes will a S9(8) COMP field occupy ?Article Number: 10017 | Last Updated: Sat, Nov 28, 2009 at 9:01 AM 4 bytes.

25) How you can read the file from bottom?Article Number: 9686 | Last Updated: Sat, Nov 28, 2009 at 1:24 AM The questions is very general. Let’s look into these possibilities:

1. QSAM (sequential) file. You can run it thru SORT utility adding SEQNUM and then sort then sort by SEQNUM in DESC order

2. VSAM: In CICS, you can read backward using READREV; i

3. VSAM: I Batch, unload the VSAM file using SORT in DESC order by

key value

26) Can we fetch/ select in working storage section varibales directly without using the host variables?Article Number: 9734 | Last Updated: Sat, Nov 28, 2009 at 2:00 AM Yes we can

27) Can Redefines clause be used in File section, if yes at which level number ?

Page 11: Cobol Mainframe Mania

Article Number: 9745 | Last Updated: Sat, Nov 28, 2009 at 2:12 AM The REDEFINES clause cannot be used in a level 01 entry in the File Section.

28) What is COMP-1? COMP-2?Article Number: 10012 | Last Updated: Sat, Nov 28, 2009 at 8:58 AM COMP-1 - Single precision floating point. Uses 4 bytes.COMP-2 - Double precision floating point. Uses 8 bytes.

29) How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?Article Number: 10016 | Last Updated: Sat, Nov 28, 2009 at 9:01 AM Will occupy 8 bytes (one extra byte for sign).

30) What are the differences between OS VS COBOL and VS COBOL II?Article Number: 10035 | Last Updated: Sat, Nov 28, 2009 at 9:18 AM 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.Report writer is supported only in OS/VS Cobol.USAGE IS POINTER is supported only in VS COBOL II.Reference modification e.g.: WS-VAR(1:2) is supported only in VS COBOL II.EVALUATE is supported only in VS COBOL II.Scope terminators are supported only in VS COBOL II.OS/VS Cobol follows ANSI 74 standards while VS COBOL II follows ANSI 85 standards.Under CICS Calls between VS COBOL II programs are supported.

31) How may do the following definitions occupy? (a) s(3)v99 comp-3 (b) s(9)v99 comp

Page 12: Cobol Mainframe Mania

Article Number: 10045 | Last Updated: Sat, Nov 28, 2009 at 9:51 AM Poor syntax. S9(3)V99 is correct and occupies 3 bytes. Count the number of 9’s add 1 and divide by 2 rounding up if necessary. ex.

S9(7)v99. there are 9 nines. (9+1)/2 = 5 bytes.

S9(6)V99. there are 8 nines (8+1)/2 = 4.5 = 5 bytes.

binary data (COMP) has no fractions, integers only.

32) 1) Without execution cobol program how to see output? 2) How to rename input filename and outputfile name? 3) Wat is flag? 4) What is impact analysis what basis how will you write test cases? 5) How you sea output of cics command? 6) How are datArticle Number: 10052 | Last Updated: Sat, Nov 28, 2009 at 10:00 AM According to my knowledge,

1) You cannot see the output of a program unless you have executed the program. but You can see the results of a CICS pgm using INTERTEST.

2) I DONT KNOW

3) Flags would be assigned a value based on some condition. While using it for some processing, there is no need to calculating every time. u can calculate one time and keep the decision saved in a varibale. this can be used multiple times.

4) Say you are changing a module, this module may be interacting with many other modules or the results of this module may be used by some other module. Any changes done for some bug fix in this module should not change the functionality of any module. This is main purpose of Imapct analysis.

Page 13: Cobol Mainframe Mania

To write the test cases, we need to be aware of the functioanlity of the module and the working of the module.

5)Intertest while testing.....

6) //DDNAME DD DSN=file1. file,DISP=SHR

// DD DSN=file2.file, DISP=SHR

// DD DSN=file3.file, DISP=SHR

33) What is a bind?Article Number: 9692 | Last Updated: Sat, Nov 28, 2009 at 1:28 AM A bind associates record types with the program work area; for run unit and records it is the first command issued in the program.

Binding is a process that creates the access path logic for the sql statements within a cobol program. after precompilation of a cobol program a dbrm(has all the embedded sql statements) is created. This dbrm is then bound to form a plan(executable form of the sql statements).

34) I submitted the batch job in jcl and i went to my home.the next day i came and i want to see 1- job submitted time. 2- job execution time. 3- cpu time from TSO option but not into the jcl itself. tell me TSO option for this.Article Number: 9717 | Last Updated: Sat, Nov 28, 2009 at 1:41 AM There is no TSO option for that.Go to your spool and check for the details of the job

Page 14: Cobol Mainframe Mania

35) How to include system time & date in the report generation in cobol programing?Article Number: 9741 | Last Updated: Sat, Nov 28, 2009 at 2:08 AM ACCEPT WS-ACCEPT-DATE FROM DATE.

ACCEPT WS-ACCEPT-TIME FROM TIME.

declare ws-accept-date and ws-accept-time in working-storage section

36) In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution?Article Number: 9749 | Last Updated: Sat, Nov 28, 2009 at 2:14 AM If you coded test before the cond is 1st checked then perform statement will execute where as in test after the perform statement will execute 1st then the cond is checked

37) What is the difference between NEXT SENTENCE and CONTINUE?Article Number: 9951 | Last Updated: Sat, Nov 28, 2009 at 7:45 AM NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II’s finer implementations). It’s safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.

38) What is a junction record?Article Number: 9968 | Last Updated: Sat, Nov 28, 2009 at 7:59 AM A junction record is a member record type that allows for many-to-many relationship between its two owner records. For a school

Page 15: Cobol Mainframe Mania

database the CLASS record is a junction for the TEACHER and SUBJECT record types

39) How do you define a table/array in COBOL?Article Number: 9988 | Last Updated: Sat, Nov 28, 2009 at 8:16 AM 01 ARRAYS.05 ARRAY1 PIC X(9) OCCURS 10 TIMES.05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.

40) What is the maximum size of a 01 level item in in COBOL II?

16777215

41) What is te difference between Call and Link in cobol?Article Number: 10050 | Last Updated: Sat, Nov 28, 2009 at 9:59 AM A Cobol Call can be done from a batch or a CICS program and is used to pass and receive data back from another cobol program. CALL XPDF321 USING PDF321-LK. would be a dynamic call (resolved at execution time), CALL ’XPDF321’ USING PDF321-LK would be a static call resolved when the program is compiled. A call from a CICS program would be outside of CICS since it does not involve the exec cics command.

A link is a CICS command and is used to pass data to and receive data from a CICS program. data is passed in the CICS commarea.

42) How include time & date in the report generation in cobol programing?

Page 16: Cobol Mainframe Mania

Article Number: 9748 | Last Updated: Sat, Nov 28, 2009 at 2:13 AM This can be done in 2 ways, 1 is u can enter the date by user itself or u can excpet date form system into requried formate date/time variable, then u can get time and day into urreport generation file

43) What does a ROLLBACK do?Article Number: 9973 | Last Updated: Sat, Nov 28, 2009 at 8:05 AM It rolls back (reverses) all database updates to the point of the last rollback or to the beginning of the run-unit.

44) What does the INITIALIZE verb do? ?Article Number: 9984 | Last Updated: Sat, Nov 28, 2009 at 8:13 AM Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.Numeric, Numeric edited items set to ZERO.FILLER , OCCURS DEPENDING ON items left untouched.

45) What is the difference between performing a SECTION and a PARAGRAPH?Article Number: 9995 | Last Updated: Sat, Nov 28, 2009 at 8:25 AM Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.Performing a PARAGRAPH will cause only that paragraph to be performed.

46) How do you come out of an EVALUATE statement?Article Number: 9998 | Last Updated: Sat, Nov 28, 2009 at 8:28 AM After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.

Page 17: Cobol Mainframe Mania

47) Can I redefine an X(100) field with a field of X(200)?Article Number: 10005 | Last Updated: Sat, Nov 28, 2009 at 8:34 AM Yes. Redefines just causes both fields to start at the same location. For example:01 WS-TOP PIC X(1)01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).If you MOVE ’12’ to WS-TOP-RED,DISPLAY WS-TOP will show 1 whileDISPLAY WS-TOP-RED will show 12.

48) What do you do to resolve SOC-7 error?Article Number: 10007 | Last Updated: Sat, Nov 28, 2009 at 8:35 AM Basically you need to correct the offending data.Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.Many installations provide you a dump for run time abends (it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL.If none of these are helpful, use judgment and DISPLAY to localize the source of error.Some installation might have batch program debugging tools. Use them.

49) How is sign stored in a COMP field ?Article Number: 10010 | Last Updated: Sat, Nov 28, 2009 at 8:57 AM In the most significant bit. Bit is on if -ve, off if +ve.

Page 18: Cobol Mainframe Mania

50) What is the difference between COMP & COMP-3 ?Article Number: 10011 | Last Updated: Sat, Nov 28, 2009 at 8:57 AM COMP is a binary storage format while COMP-3 is packed decimal format.

51) How do you define a variable of COMP-1? COMP-2?Article Number: 10013 | Last Updated: Sat, Nov 28, 2009 at 8:59 AM No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.

52) What is file status 39 ?Article Number: 10027 | Last Updated: Sat, Nov 28, 2009 at 9:09 AM Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL program & the JCL (or the dataset label). You will get file status 39 on an OPEN.

53) What is RESIDENT progammeArticle Number: 10048 | Last Updated: Sat, Nov 28, 2009 at 9:57 AM A RESIDENT program is one that is loaded into the CICS cashe. This will improve the performance of the application by not having to re-load them into memory.

54) How to remove the duplicate records present in a PS dataset using JCL?Article Number: 10056 | Last Updated: Sat, Nov 28, 2009 at 10:04 AM Just use this code.

//sysin dd *

sort fields=COPY

Page 19: Cobol Mainframe Mania

SUMFIELDS=NONE

/*

By using this we could remove the duplicate records from PS dataset.

55) So manual and automatic are the connect options for a set. What are the disconnect options.Article Number: 9694 | Last Updated: Sat, Nov 28, 2009 at 1:30 AM Mandatory and optional.

56) When you are obtaining next within a set and get a end of set return code, on what record are you now current?Article Number: 9700 | Last Updated: Sat, Nov 28, 2009 at 1:35 AM You are current on the owner.

57) Is there a application program coding difference between local and central version mode?Article Number: 9702 | Last Updated: Sat, Nov 28, 2009 at 1:37 AM No. The mode is specified via the SYSCTL DD card in the JCL.

Page 20: Cobol Mainframe Mania

58) What is LENGTH in COBOL II?Article Number: 9743 | Last Updated: Sat, Nov 28, 2009 at 2:09 AM LENGTH acts like a special register to tell the length of a group or elementary item.

59) What is the maximum size of the variable length record?Article Number: 9746 | Last Updated: Sat, Nov 28, 2009 at 2:12 AM The size of Variable Length Record changes from Computer to Computer, so there is no specific limit.4096k is the max variable length record

60) Explain call by context by comparing it to other calls.Article Number: 9750 | Last Updated: Sat, Nov 28, 2009 at 2:15 AM I think this Q&A should say "CONTENT" rather than "context".

61) What is an in line PERFORM? When would you use it? Anything else to say about it?Article Number: 9754 | Last Updated: Sat, Nov 28, 2009 at 2:18 AM The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraph

Page 21: Cobol Mainframe Mania

62) What COBOL construct is the COBOL II EVALUATE meant to replace?Article Number: 9952 | Last Updated: Sat, Nov 28, 2009 at 7:46 AM EVALUATE can be used in place of the nested IF THEN ELSE statements.

63) What is the linkage section?Article Number: 9954 | Last Updated: Sat, Nov 28, 2009 at 7:49 AM The linkage section is part of a called program that ’links’ or maps to data items in the calling program’s working storage. It is the part of the called program where these share items are defined.

64) What is the difference between comp and comp-3 usage? Explain other COBOL usages.Article Number: 9955 | Last Updated: Sat, Nov 28, 2009 at 7:50 AM COMP

Comp is used for Binary Representation

it allows only S and 9 ...

s9(01) to s9(04) it takes 2 bytes memory

s9(05) to s9(09) it takes 4 bytes memory

s9(10) to s9(18) it takes 8 bytes memory

COMP-3

Page 22: Cobol Mainframe Mania

Comp-3 is used for Packed Decimal values

it allows S,9 ,V

mostly it is useful for Decimal Caluculation Values

it takes (n/2)+1 Bytes Memory

65) What is SET TO TRUE all about, anyway?Article Number: 9958 | Last Updated: Sat, Nov 28, 2009 at 7:52 AM The set to true is done for 88 level variables to set that flag

For eg: 05 ws-change-flag pic x(1).

88 ws-chg value ’Y’

88 ws-no-chg value ’N’

when set ws-chg to true is done then ws-change-flag contains value ’Y’ .It is same as move ’Y’ to ws-change-flag

If the statement is set ws-no-chg to true then ws-change-flag contains value ’N’.It is same is move ’N’ to ws-change-flag

At one point of time only one flag can be set.

66) Explain the difference between record occurrence and record type.Article Number: 9963 | Last Updated: Sat, Nov 28, 2009 at 7:56 AM A record occurrence is the instances of a record; it is the smallest addressable unit of data. A type is the description of a record; there need not be any occurrences

67) Name and explain the three location modes.

Page 23: Cobol Mainframe Mania

Article Number: 9969 | Last Updated: Sat, Nov 28, 2009 at 8:00 AM Calc is based on a symbolic value which is used to determine the target page. Via mode is for members only. Via records are stored near to their owners. In direct mode the target is specified by the user and is stored as close as possible to that page

68) What does a store statement do?Article Number: 9979 | Last Updated: Sat, Nov 28, 2009 at 8:08 AM It places a record in the database based on the location mode specified.

69) How do you define a sort file in JCL that runs the COBOL program?Article Number: 9994 | Last Updated: Sat, Nov 28, 2009 at 8:24 AM Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.

70) What is the difference between CONTINUE & NEXT SENTENCE?Article Number: 10003 | Last Updated: Sat, Nov 28, 2009 at 8:33 AM CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)

71) What does EXIT do?Article Number: 10004 | Last Updated: Sat, Nov 28, 2009 at 8:33 AM Does nothing! If used, must be the only sentence within a paragraph.

Page 24: Cobol Mainframe Mania

72) How is sign stored in Packed Decimal fields and Zoned Decimal fields?Article Number: 10008 | Last Updated: Sat, Nov 28, 2009 at 8:36 AM Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

73) How do you reference the following file formats from COBOL programs:Article Number: 10021 | Last Updated: Sat, Nov 28, 2009 at 9:05 AM Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINSVariable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY ISRRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY ISPrinter File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).

74) What is SSRANGE, NOSSRANGE?

Page 25: Cobol Mainframe Mania

Article Number: 10032 | Last Updated: Sat, Nov 28, 2009 at 9:15 AM These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.

75) What are the steps you go through while creating a COBOL program executable?Article Number: 10036 | Last Updated: Sat, Nov 28, 2009 at 9:18 AM DB2 precompiler (if embedded sql used), CICS translator (if CICS program), COBOL compiler, Link editor.If DB2 program, create plan by binding the DBRMs.

76) What is Static,Dynamic linking ?Article Number: 10043 | Last Updated: Sat, Nov 28, 2009 at 9:49 AM In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

77) Can we use redefine clause in occurs clause?Article Number: 10046 | Last Updated: Sat, Nov 28, 2009 at 9:52 AM Yes we can use redefines clause in occurs clauseeg:01 number1 pic x(10) value spaces.01 number2 redefines number1 pic x occurs 10 times.

Page 26: Cobol Mainframe Mania

78) suppose i have array of 10 elemnts in it how to acess 5 element from the arrayusing supscript and indexArticle Number: 10053 | Last Updated: Sat, Nov 28, 2009 at 10:01 AM if you have an array with 10 elements like this :

int a[] = {1,2,3,4,5,6,7,8,9,10};

To access the 5th element, you need to write a[4]. Because, Array index starts from 0. In this case 0th element is 1, 1st element is 2.. etc

79) Can Redefines clause be used at 01 level ?Article Number: 10057 | Last Updated: Sat, Nov 28, 2009 at 10:05 AM Redefines clause can be used at 01 Level. However the variable you are Redefining must also be declared at the Level. Infact only at 01 level you can redefine a part of the variable instead of having to Redefine for the entire length.

80) If the stored record is not defined as automatic of a set, how can it be stored as a member of the set.Article Number: 9693 | Last Updated: Sat, Nov 28, 2009 at 1:29 AM Store the record then connect it to each set where it is a manual member.

Page 27: Cobol Mainframe Mania

81) What does a status return code of nn29 mean in relation to record locks.Article Number: 9697 | Last Updated: Sat, Nov 28, 2009 at 1:33 AM nn29 means that two run units are waiting to set locks on the same record and are in deadlock.

82) What is an area sweep and when is it used?Article Number: 9698 | Last Updated: Sat, Nov 28, 2009 at 1:33 AM An area sweep accesses records on the basis of the physical location in a database area. It can be total, meaning a record by record search of the area, or it can be of occurrences of records of a specific type.

83) If you are current on the owner of a set, what is the difference between an obtain next and obtain first?Article Number: 9705 | Last Updated: Sat, Nov 28, 2009 at 1:38 AM No difference. There is a difference between obtain first and obtain next for an area sweep, but not when current on the owner in a set.

84) Is it possible that the REDEFINES clause has different picture clauses compared to the one it redefined?Article Number: 9707 | Last Updated: Sat, Nov 28, 2009 at 1:38 AM well, generally it is not possible.Yes, we can have different PIC clauses. Eg:

Page 28: Cobol Mainframe Mania

05 REGULAR-EMPLOYEE.10 LOCATION PICTURE A(8).10 GRADE PICTURE X(4).10 SEMI-MONTHLY-PAY PICTURE 9999V99.10 WEEKLY-PAY REDEFINES SEMI-MONTHLY-PAYPICTURE 999V999.05 TEMPORARY-EMPLOYEE REDEFINES REGULAR-EMPLOYEE.10 LOCATION PICTURE A(8).10 FILLER PICTURE X(6).10 HOURLY-PAY PICTURE 99V99.

85) 77 CTR PIC S9(4)V99 VALUE 1234.55. What will be output of the statement DISPLAY CTR?Article Number: 9726 | Last Updated: Sat, Nov 28, 2009 at 1:50 AM Display CTR will contain 12345E coz +ve sign will be stored on rightmost digit

86) What is the logical difference b/w Move A TO B and COMPUTE B = A.Article Number: 9728 | Last Updated: Sat, Nov 28, 2009 at 1:52 AM In case of Move A TO B it will move whatever the value of a in to b.

it mean it will move numeric, alphanumeric and alphabatic value.

In case of COMPUTE B = A it will assign the vale of a in to b.

but in case of compute only numeric value will be compute.

87) What is the maximum size of table space?Article Number: 9733 | Last Updated: Sat, Nov 28, 2009 at 1:59 AM

Page 29: Cobol Mainframe Mania

A tablespace is not a COBOL concept it’s pure DB2. In version 8 of DB2 using a partitioned tablespace with 4096 partitions and a page size of 32K, the table space can reach 128 Tb. (that’s terabytes, 128 trillion, 128 million gigabytes, 128,000,000,000,000 bytes) pretty big.

88) What is the difference between a subscript and an index in a table definition?Article Number: 9735 | Last Updated: Sat, Nov 28, 2009 at 2:03 AM A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decremented by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program’s working storage. You SET an index to a value and SET it UP BY value and DOWN BY value

89) Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.Article Number: 9736 | Last Updated: Sat, Nov 28, 2009 at 2:04 AM External sort is performed by SORT pgm. Internal sort gives you data handling flexibility and it takes less secondary memory. For huge Volume of files it’s better to use internal sort else large amount of space will be required in external sort. any comments...?

90) If you were passing a table via linkage, which is preferable - a subscript or an index?Article Number: 9751 | Last Updated: Sat, Nov 28, 2009 at 2:16 AM Please don’t forget that u cannot pass a Index via linkage section as it is not defined in the working storage section. It is something defined by the system.

Page 30: Cobol Mainframe Mania

91) What is an explicit scope terminator?Article Number: 9753 | Last Updated: Sat, Nov 28, 2009 at 2:17 AM Terminators like END-PEROFRM END-EVALUTE are called explicit scope terminaotr available in COBOL 85.

92) When is a scope terminator mandatory?Article Number: 9956 | Last Updated: Sat, Nov 28, 2009 at 7:51 AM Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it’s recommended coding practice to always make scope terminators explicit.

What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.Article Number: 9957 | Last Updated: Sat, Nov 28, 2009 at 7:51 AM INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.

What is the point of the REPLACING option of a copy statement?Article Number: 9960 | Last Updated: Sat, Nov 28, 2009 at 7:54 AM COPY AR00RB REPLACING ==:AR00:== BY ==AMBS==.

AR00RB COPY BOOK AS FOLLOWS AS (iam copying only few lines of code)

01 :AR00:RB-WORK-AREA

Page 31: Cobol Mainframe Mania

03 :AR00:RB-IO-REQUEST PIC S9(04) BINARYVALUE ZERO88 :AR00:RB-OPEN-INPUT VALUE +01.88 :AR00:RB-OPEN-OUTPUT VALUE +02.88 :AR00:RB-OPEN-IO VALUE +03.88 :AR00:RB-OPEN-INPUT- DYN VALUE +04.88 :AR00:RB-OPEN-OUTPUT-DYN VALUE +05.88 :AR00:RB-OPEN-IO-DYN VALUE +06.88 :AR00:RB-OPEN-INPUT-RDM VALUE +07.88 :AR00:RB-OPEN-OUTPUT-RDM VALUE +08.88 :AR00:RB-OPEN-IO-RDM VALUE +09.88 :AR00:RB-START-GTE VALUE +10.

Here that copy statement replace with AMBS in place :AR00:

What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.Article Number: 9957 | Last Updated: Sat, Nov 28, 2009 at 7:51 AM INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.

How many dimensions does cobol have ? Why cobol is written in coding sheet? Why is the cobol program used? is it still in use? is it for business purpose?Article Number: 9966 | Last Updated: Sat, Nov 28, 2009 at 7:58 AM

Page 32: Cobol Mainframe Mania

Yes, COBOL is for business use.

Yes, it is still in use.

COBOL programs are used bcoz it is business oriented language, more flexible, easy to code and easy to understand.

COBOL sheet is depends on editor and compiler.

What is a set? What pointers are required, what are possible? How may sets be ordered?Article Number: 9970 | Last Updated: Sat, Nov 28, 2009 at 8:01 AM A set is an owner record and, optionally, its member records. There are three types of pointers: next, prior and owner, but only next is required. There are five possible orders for arrangements of sets; they are: first - insert at beginning, last - insert at end of set, next - insert after current of set, prior - insert prior to current of set and sorted - insert according to sort value.

What does a COMMIT statement do?Article Number: 9972 | Last Updated: Sat, Nov 28, 2009 at 8:04 AM It writes a checkpoint to the Journal File and releases any record locks.

What is the meaning of the return codes 0307 and 0326?Article Number: 9976 | Last Updated: Sat, Nov 28, 2009 at 8:06 AM 0307 is end-of-set and 0326 is record not found. 0307 is end-of-set and 0326 is record not found.

Page 33: Cobol Mainframe Mania

What is currency?Article Number: 9981 | Last Updated: Sat, Nov 28, 2009 at 8:11 AM The old joke - where the programmer thinks he is, but the DBMS knows he is not. Currency is the location within the database during run-unit execution. There are four levels of currency: current of run-unit is the record occurrence of the last successful find or obtain; current of record type is for the most recent of each record type; current of record set is the most recent within each set and current of area is within each area.

What are the different data types available in COBOL?Article Number: 9983 | Last Updated: Sat, Nov 28, 2009 at 8:13 AM Alpha-numeric (X), alphabetic (A) and numeric (9)

What is 77 level used for ?Article Number: 9985 | Last Updated: Sat, Nov 28, 2009 at 8:14 AM Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.

What is the difference between index and subscript?Article Number: 9989 | Last Updated: Sat, Nov 28, 2009 at 8:16 AM Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.Need to have index for a table in order to use SEARCH, SEARCH ALL.

What should be the sorting order for SEARCH ALL?

Page 34: Cobol Mainframe Mania

Article Number: 9991 | Last Updated: Sat, Nov 28, 2009 at 8:22 AM It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).

What is binary search?Article Number: 9992 | Last Updated: Sat, Nov 28, 2009 at 8:23 AM Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.14. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.Article Number: 9993 | Last Updated: Sat, Nov 28, 2009 at 8:24 AM Syntax:SORT file-1 ON ASCENDING/DESCENDING KEY key....USING file-2GIVING file-3.USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.file-1 is the sort work file and must be described using SD entry in FILE SECTION.file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.file-3 is the out file from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.file-1, file-2 & file-3 should not be opened explicitly.INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.

Page 35: Cobol Mainframe Mania

OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.

What are the different forms of EVALUATE statement?Article Number: 9997 | Last Updated: Sat, Nov 28, 2009 at 8:28 AM EVALUATE EVALUATE SQLCODE ALSO FILE-STATUSWHEN A=B AND C=D WHEN 100 ALSO ’00’imperative stmt imperative stmtWHEN (D+X)/Y = 4 WHEN -305 ALSO ’32’imperative stmt imperative stmtWHEN OTHER WHEN OTHERimperative stmt imperative stmtEND-EVALUATE END-EVALUATEEVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUEWHEN 100 ALSO TRUE WHEN 100 ALSO A=Bimperative stmt imperative stmtWHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)imperative stmt imperative stmtEND-EVALUATE END-EVALUATE

In an EVALUATE statement, can I give a complex condition on a when clause?Article Number: 9999 | Last Updated: Sat, Nov 28, 2009 at 8:29 AM Yes

What is a scope terminator? Give examples.Article Number: 10000 | Last Updated: Sat, Nov 28, 2009 at 8:30 AM

Page 36: Cobol Mainframe Mania

Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.

How do you do in-line PERFORM?Article Number: 10001 | Last Updated: Sat, Nov 28, 2009 at 8:31 AM PERFORM ... ...END PERFORM

How is sign stored in a comp-3 field?Article Number: 10009 | Last Updated: Sat, Nov 28, 2009 at 8:36 AM It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc..

What is COMP SYNC?Article Number: 10019 | Last Updated: Sat, Nov 28, 2009 at 9:03 AM Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and nextone is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to thiscomputational field is faster.

Page 37: Cobol Mainframe Mania

Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?Article Number: 10025 | Last Updated: Sat, Nov 28, 2009 at 9:08 AM Can rewrite (record length must be same), but not delete.

What is Static, Dynamic linking?Article Number: 10028 | Last Updated: Sat, Nov 28, 2009 at 9:10 AM In static linking, the called subroutine is link-edited into the calling program, while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to onlyArticle Number: 10029 | Last Updated: Sat, Nov 28, 2009 at 9:11 AM These are compile/link edit optio

Page 38: Cobol Mainframe Mania

What compiler option would you use for dynamic linking?Article Number: 10031 | Last Updated: Sat, Nov 28, 2009 at 9:15 AM DYNAM.

How do you set a return code to the JCL from a COBOL program?Article Number: 10033 | Last Updated: Sat, Nov 28, 2009 at 9:16 AM Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

How can you submit a job from COBOL programs?Article Number: 10034 | Last Updated: Sat, Nov 28, 2009 at 9:16 AM Write JCL cards to a dataset with//xxxxxxx SYSOUT=(A,INTRDR) where ’A’ is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.

What is difference between comp & comp-4?Article Number: 10058 | Last Updated: Sat, Nov 28, 2009 at 10:05 AM comp is :- 1 TO 4 = 2 BYTES,5 TO 9 = 4 BYTES,10 TO 18 = 8 BYTES.

comp-4 :- maximum limit is 9(18) and it is taking according to the

pic Clause.

Page 39: Cobol Mainframe Mania

What does the INITIALIZE verb do?Article Number: 10038 | Last Updated: Sat, Nov 28, 2009 at 9:21 AM Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.

Numeric, Numeric edited items set to ZERO.

Fillers, Occurs DEPENDING ON items left untouched.

Can you call an OS VS COBOL program from a VS COBOL II program?Article Number: 10037 | Last Updated: Sat, Nov 28, 2009 at 9:19 AM In non-CICS environment, it is possible. In CICS, this is not possible.

What are different file OPEN modes available in COBOL? aArticle Number: 10022 | Last Updated: Sat, Nov 28, 2009 at 9:06 AM Open for INPUT, OUTPUT, I-O, EXTEND.

What is the use of EVALUATE statement?Article Number: 9996 | Last Updated: Sat, Nov 28, 2009 at 8:27 AM Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no ’break’ is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.

Page 40: Cobol Mainframe Mania

What is the difference between SEARCH and SEARCH ALL?Article Number: 9990 | Last Updated: Sat, Nov 28, 2009 at 8:21 AM SEARCH - is a serial search.SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before usingSEARCH ALL.

What sets will the stored record connect to?Article Number: 9980 | Last Updated: Sat, Nov 28, 2009 at 8:09 AM It will connect to all sets where it is defined as an automatic member. The store requires that currency be established for all these set occurrences.

In the example below 05 WS-VAR1 PIC X(5) 05 WS-VAR2 REDEFINES WA-VAR1 PIC 9(5). PROCEDURE DIVISION MOVE ’ABCDE’ TO WS-VAR1. now what is the value of WS-VAR1 and WS-VAR2 ?Article Number: 9747 | Last Updated: Sat, Nov 28, 2009 at 2:13 AM ws-va2 is redefined with wa-var1,where wa-var1 is not decalred,then it will b a error.

if it is typo error and ws-va2 is redefined to ws-va1,then both the values will b abcde :-)

Page 41: Cobol Mainframe Mania

What are the HIGH Values,LOW values and where we can use?Article Number: 9739 | Last Updated: Sat, Nov 28, 2009 at 2:07 AM HIGH-VALUES and LOW-VALUES are figurative constants. In HIGH-VALUES, all the bits in the byte are on ie:FFFFFFFFIn LOW-VALUES, all the bits in the byte are off. ie. 00000000.I’ve mostly see it used in sequential updating of a master file.

What are the types of record locks and how are they set?Article Number: 9696 | Last Updated: Sat, Nov 28, 2009 at 1:31 AM Locks may be shared or exclusive. Shared means that other run units can retrieve the record but can not modify it. Exclusive means that other run units can neither retrieve nor modify it. Recordlocks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command.

How are record locks released?Article Number: 9682 | Last Updated: Sat, Nov 28, 2009 at 1:22 AM Locks are released by a change in currency or by a commit, rollback or finish command.

I have a variable x(20), but i need the out as in two ways 1.12300000000000000000 2.123-----------------

Page 42: Cobol Mainframe Mania

Article Number: 10055 | Last Updated: Sat, Nov 28, 2009 at 10:03 AM 2nd option for 12300000000000000000

01 a pic x(20) value ’123’.

procedure division.

inspect a replacing all space by zero.

display a.

2nd question for 123-----------------

01 a pic x(20) value ’123’.

procedure division.

inspect a replacing all space by ’-’.

display a.

What does the IS NUMERIC clause establish ?Article Number: 10040 | Last Updated: Sat, Nov 28, 2009 at 9:23 AM IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and usigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .