Cobolfaq
Cobolfaq
Cobolfaq
doc
Answer: They appear to be similar, that is, the control goes to the next sentence
in the paragraph. But, Next Sentence would take the control to the sentence after
it finds a fullstop (.). Check out by writing the following code example, one if
sentence followed by 3 display statements (sorry they appear one line here
because of formatting restrictions) If 1 > 0 then next sentence end if display 'line
1' display 'line 2'. display 'line 3'. *** Note- there is a dot (.) only at the end of
the last 2 statements, see the effect by replacing Next Sentence with Continue ***
Hope this helps!
Question: I understand the possible causes for S0C1 & S0C4 abends, but what
are they really?
Answer: A S0C1 occurs if the CPU attempts to execute binary code that isn't a
valid machine instruction; e.g. if you attempt to execute data. A S0C4 is a
memory protection violation. This occurs if a program attempts to access storage
beyond the areas assigned to it.
Answer: ?????????
Page 1 of 8
366043931.doc
Answer: ?????????????
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
Page 2 of 8
366043931.doc
Question: What are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends
Question: Question: What will happen if you code GO BACK instead of STOP
RUN in a stand alone COBOL program i.e. a program which is not calling any
other program.
Answer: Both give the same results when a program is not calling any other
program. The answer given by Mr.Krishnan that when go back is coded the
program goes into infinite loop is not correct. Goback will give the control to the
system even though it is a single program.
Page 3 of 8
366043931.doc
Answer: Global variables are accessible only to the batch program whereas
external variables can be referenced from any batch program residing in the
same system library.
Answer: In using COBOL on PC we have only flat files and the programs can
access only limited storage, whereas in VS COBOL II on M/F the programs can
access upto 16MB or 2GB depending on the addressing and can use VSAM files
to make I/O operations faster.
Answer: because, Occurs clause is there to repeat fields with same format, not
the records.
Answer: PSB : Program specification block. Infor about how a specific program
is to be access one or more IMS DB. It consist of PCB(Prg Communication
Block). Information to which which segment in DB can be accessed, what the
program is allowed to do with those segment and how the DB is to be accessed.
ACB : Access Control Blocks are generated by IMS as an expansion of
information contained in the PSB in order to speed up the access to the
applicable DBD's.
Question: Question: What's a LDS(Linear Data Set) and what's it used for ?
Page 4 of 8
366043931.doc
Question: answer to anon question for difference between next and continue
cluase
Answer: FOR ANON , Dear friend the difference between the next and continue
verb is that in the continue verb it is used for a situation where there in no eof
condition that is the records are to be accessed again and again in an file ,
whereas in the next verb the indexed file is accessed sequentially ,hence when
index clase is accessed sequentially read next record command is used,i hope that
is satisfactory
Question: what is the difference between search and search all in the table
handling?
Question: What is the maximum length of a field you can define using COMP-3?
Page 5 of 8
366043931.doc
Question: What will happen if you code GO BACK instead of STOP RUN in a
stand alone COBOL program i.e. a program which is not calling any other
program.
Answer: The ONLY way is to look at the output of the linkage editor (IEWL)or
the load module itself. If the module is being called DYNAMICALLY then it will
not exist in the main module, if it is being called STATICALLY then it will be
seen in the load module.Calling a working storage varible, containing a program
name, does not make a DYNAMIC call. This type of calling is known as
IMPLICITE calling as the name of the module is implied by the contents of the
working storage varible. Calling a program name literal (CALL
Answer: PIC 9.99 is a four position field that actually contains a decimal point
where as 9v99 is a three position numeric field with an implied or assumed
decimal point.
Page 6 of 8
366043931.doc
Question: read the following code. 01 ws-n pic 9(2) value zero. a-para move 5 to
ws-n. perform b-para ws-n times.b-para. move 10 to ws-n.how many times will b-
para be executed ?
Answer: 5 times only. it will not take the value 10 that is initialized in the loop.
Question: What is the difference between SEARCH and SEARCH ALL? What is
more efficient?
Question: What care has to be taken to force program to execute above 16 Meg
line?
Answer: 1. You can REDEFINE a Variable from one PICTURE class to another
PICTURE class by using the same memory location.2. By REDEFINES we can
INITIALISE the variable in WORKING-STORAGE Section itself.3. We can
REDEFINE a Single Variable into somany subvariables.(This facility is very
useful in solving Y2000 Problem.)
Page 7 of 8
366043931.doc
Answer: Here s9(4)comp is small integer ,so two words equal to i byteso totally it
will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2
byte.4 words equal to 2 bytes and sign will occupy 1/2 byteso totally it will
occupy 3 bytes.
Answer: The linkage section is used to pass data from one program toanother
program or to pass data from a PROC to a program.
Page 8 of 8