0% found this document useful (0 votes)
74 views

Cobol Short Questions

The document contains questions and answers related to COBOL programming. It discusses various COBOL concepts like data types, divisions in a COBOL program, defining and using arrays, sorting files, and performing searches. It also covers statements like EVALUATE, PERFORM, and procedures. Common errors like subscript out of range are addressed.

Uploaded by

malliknl
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Cobol Short Questions

The document contains questions and answers related to COBOL programming. It discusses various COBOL concepts like data types, divisions in a COBOL program, defining and using arrays, sorting files, and performing searches. It also covers statements like EVALUATE, PERFORM, and procedures. Common errors like subscript out of range are addressed.

Uploaded by

malliknl
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

M.

MALLIKARJUNA RAO
COBOL SHORT QUESTIONS

Q1) Name the divisions in a COBOL program .
A1) I!"N#I$ICA#ION !I%I&ION' "N%IRONM"N# !I%I&ION' !A#A
!I%I&ION' (ROC"!UR" !I%I&ION.

Q)) *hat are the di++erent data t,pes avai-a.-e in COBOL
A)) A-pha/n0meri1 23)' a-pha.eti1 2A) and n0meri1 24).

Q5) *hat does the INI#IALI6" ver. do / 7&
A5) A-pha.eti1' A-phan0meri1 +ie-ds 8 a-phan0meri1 edited items are set to
&(AC"&. N0meri1' N0meri1 edited items set to 6"RO. $ILL"R ' OCCUR&
!"("N!IN7 ON items -e+t 0nto01hed.

Q9) *hat is :: -eve- 0sed +or
A9) "-ementar, -eve- item. Cannot .e s0.divisions o+ other items 21annot .e
;0a-i+ied)' nor 1an the, .e s0.divided themse-ves.

Q<) *hat is == -eve- 0sed +or
A<) $or 1ondition names.

Q>) *hat is -eve- >> 0sed +or
A>) $or R"NAM"& 1-a0se.

Q:) *hat does the I& NUM"RIC 1-a0se esta.-ish
A:) I& NUM"RIC 1an .e 0sed on a-phan0meri1 items' signed n0meri1 8 pa1?ed
de1ima- items and 0nsigned n0meri1 8 pa1?ed de1ima- items. I& NUM"RIC ret0rns
#RU" i+ the item on-, 1onsists o+ @/4. AoBever' i+ the item .eing tested is a signed
item' then it ma, 1ontain @/4' C and / .

Q=) AoB do ,o0 de+ine a ta.-eDarra, in COBOL
A=) ARRAE&.
@< ARRAE1 (IC 324) OCCUR& 1@ #IM"&.
@< ARRAE) (IC 32>) OCCUR& )@ #IM"& IN!"3"! BE *&/IN!"3.

Q4) Can the OCCUR& 1-a0se .e at the @1 -eve-
A4) No.

Q1@) *hat is the di++eren1e .etBeen indeF and s0.s1ript / 7&
A1@) &0.s1ript re+ers to the arra, o110rren1e Bhi-e indeF is the disp-a1ement 2in no o+
.,tes) +rom the .eginning o+ the arra,.
An indeF 1an on-, .e modi+ied 0sing ("R$ORM' &"ARCA 8 &"#. Need to have
indeF +or a ta.-e in order to 0se &"ARCA' &"ARCA ALL.

Q11) *hat is the di++eren1e .etBeen &"ARCA and &"ARCA ALL / 7&
A11) &"ARCA / is a seria- sear1h.
&"ARCA ALL / is a .inar, sear1h 8 the ta.-e m0st .e sorted
2 A&C"N!IN7D!"&C"N!IN7 K"E 1-a0se to .e 0sed 8 data -oaded in this order)
.e+ore 0sing &"ARCA ALL.

Q1)) *hat sho0-d .e the sorting order +or &"ARCA ALL / 7&
A1)) It 1an .e either A&C"N!IN7 or !"&C"N!IN7. A&C"N!IN7 is de+a0-t. I+
,o0 Bant the sear1h to .e done on an arra, sorted in des1ending order' then Bhi-e
de+ining the arra,' ,o0 sho0-d give !"&C"N!IN7 K"E 1-a0se. 2Eo0 m0st -oad the
ta.-e in the spe1i+ied order).

Q15) *hat is .inar, sear1h
A15) &ear1h on a sorted arra,. Compare the item to .e sear1hed Bith the item at the
1enter. I+ it mat1hes' +ine e-se repeat the pro1ess Bith the -e+t ha-+ or the right ha-+
depending on Bhere the item -ies.

1
M.MALLIKARJUNA RAO
Q19) M, program has an arra, de+ined to have 1@ items. !0e to a .0g' I +ind that
even i+ the program a11ess the
11th item in this arra,' the program does not a.end. *hat is Brong Bith it

A19) M0st 0se 1ompi-er option &&RAN7" i+ ,o0 Bant arra, .o0nds 1he1?ing. !e+a0-t
is NO&&RAN7".


Q1<) AoB do ,o0 sort in a COBOL program 7ive sort +i-e de+inition' sort
statement s,ntaF and meaning. / 7&
A1<) &,ntaFG &OR# +i-e/1 ON A&C"N!IN7D!"&C"N!IN7 K"E ?e,.... U&IN7
+i-e/) 7I%IN7 +i-e/5.

U&IN7 1an .e s0.stit0ted ., IN(U# (ROC"!UR" I& para/1 #ARU para/)
7I%IN7 1an .e s0.stit0ted ., OU#(U# (ROC"!UR" I& para/1 #ARU para/).

+i-e/1 is the sort 2Bor?) +i-e and m0st .e des1ri.ed 0sing &! entr, in $IL"
&"C#ION.
+i-e/) is the inp0t +i-e +or the &OR# and m0st .e des1ri.ed 0sing an $! entr, in
$IL" &"C#ION and &"L"C#
1-a0se in $IL" CON#ROL.
+i-e/5 is the o0t +i-e +rom the &OR# and m0st .e des1ri.ed 0sing an $! entr, in
$IL" &"C#ION and &"L"C#
1-a0se in $IL" CON#ROL.
+i-e/1' +i-e/) 8 +i-e/5 sho0-d not .e opened eFp-i1it-,.

IN(U# (ROC"!UR" is eFe10ted .e+ore the sort and re1ords m0st .e R"L"A&"d
to the sort Bor? +i-e +rom the inp0t pro1ed0re.
OU#(U# (ROC"!UR" is eFe10ted a+ter a-- re1ords have .een sorted. Re1ords
+rom the sort Bor? +i-e m0st .e R"#URNed one at a time to the o0tp0t pro1ed0re.

Q1>) AoB do ,o0 de+ine a sort +i-e in JCL that r0ns the COBOL program
A1>) Use the &OR#*K@1' &OR#*K@)'..... dd names in the step. N0m.er o+ sort
datasets depends on the vo-0me o+ data
.eing sorted' .0t a minim0m o+ 5 is re;0ired.

Q1:) *hat is the di++eren1e .etBeen per+orming a &"C#ION and a (ARA7RA(A
/ 7&
A1:) (er+orming a &"C#ION Bi-- 1a0se a-- the paragraphs that are part o+ the
se1tion' to .e per+ormed.
(er+orming a (ARA7RA(A Bi-- 1a0se on-, that paragraph to .e per+ormed.

Q1=) *hat is the 0se o+ "%ALUA#" statement / 7&
A1=) "va-0ate is -i?e a 1ase statement and 1an .e 0sed to rep-a1e nested I+s. #he
di++eren1e .etBeen "%ALUA#" and
1ase is that no H.rea?H is re;0ired +or "%ALUA#" i.e. 1ontro- 1omes o0t o+ the
"%ALUA#" as soon as one mat1h is
made.

Q14) *hat are the di++erent +orms o+ "%ALUA#" statement
A14)
"%ALUA#" "%ALUA#" &QLCO!" AL&O $IL"/
&#A#U&
*A"N AIB AN! CI! *A"N 1@@ AL&O H@@H
imperative stmt imperative
stmt
*A"N 2!C3)DE I 9 *A"N /5@< AL&O H5)H
imperative stmt imperative
stmt
*A"N O#A"R *A"N O#A"R
imperative stmt imperative
stmt
"N!/"%ALUA#" "N!/"%ALUA#"

)
M.MALLIKARJUNA RAO
"%ALUA#" &QLCO!" AL&O AIB "%ALUA#" &QLCO!" AL&O
#RU"
*A"N 1@@ AL&O #RU" *A"N 1@@ AL&O AIB
imperative stmt imperative stmt
*A"N /5@< AL&O $AL&" *A"N /5@< AL&O
2ADCI9)
imperative stmt imperative stmt
"N!/"%ALUA#" "N!/"%ALUA#"

Q)@) AoB do ,o0 1ome o0t o+ an "%ALUA#" statement / 7&
A)@) A+ter the eFe10tion o+ one o+ the Bhen 1-a0ses' the 1ontro- is a0tomati1a--,
passed on to the neFt senten1e a+ter the
"%ALUA#" statement. #here is no need o+ an, eFtra 1ode.

Q)1) In an "%ALUA#" statement' 1an I give a 1omp-eF 1ondition on a Bhen
1-a0se
A)1) Ees.

Q))) *hat is a s1ope terminator 7ive eFamp-es.
A))) &1ope terminator is 0sed to mar? the end o+ a ver. e.g. "%ALUA#"' "N!/
"%ALUA#"J I$' "N!/I$.

Q)5) AoB do ,o0 do in/-ine ("R$ORM / 7&
A)5) ("R$ORM ... KUN#ILL ...
Ksenten1esL
"N!/("R$ORM

Q)9) *hen Bo0-d ,o0 0se in/-ine per+orm
A)9) *hen the .od, o+ the per+orm Bi-- not .e 0sed in other paragraphs. I+ the .od,
o+ the per+orm is a generi1 t,pe o+ 1ode
20sed +rom vario0s other p-a1es in the program)' it Bo0-d .e .etter to p0t the 1ode
in a separate (ara and 0se
("R$ORM (ara name rather than in/-ine per+orm.

Q)<) *hat is the di++eren1e .etBeen CON#INU" 8 N"3# &"N#"NC"
A)<) #he, appear to .e simi-ar' that is' the 1ontro- goes to the neFt senten1e in the
paragraph. B0t' NeFt &enten1e Bo0-d
ta?e the 1ontro- to the senten1e a+ter it +inds a +0-- stop 2.). Che1? o0t ., Briting the
+o--oBing 1ode eFamp-e' one i+
senten1e +o--oBed ., 5 disp-a, statements 2sorr, the, appear one -ine here .e1a0se
o+ +ormatting restri1tions) I+ 1 L @
then neFt senten1e end i+ disp-a, H-ine 1H disp-a, H-ine )H. disp-a, H-ine 5H. MMM Note/
there is a dot 2.) on-, at the end o+
the -ast ) statements' see the e++e1t ., rep-a1ing NeFt &enten1e Bith Contin0e
MMM

Q)>) *hat does "3I# do
A)>) !oes nothing N I+ 0sed' m0st .e the on-, senten1e Bithin a paragraph.

Q):) Can I rede+ine an 321@@) +ie-d Bith a +ie-d o+ 32)@@)
A):) Ees. Rede+ines O0st 1a0ses .oth +ie-ds to start at the same -o1ation. $or
eFamp-eG

@1 *&/#O( (IC 321)
@1 *&/#O(/R"! R"!"$IN"& *&/#O( (IC 32)).
I+ ,o0 MO%" H1)H to *&/#O(/R"!'
!I&(LAE *&/#O( Bi-- shoB 1 Bhi-e
!I&(LAE *&/#O(/R"! Bi-- shoB 1).

A)=) Can I rede+ine an 32)@@) +ie-d Bith a +ie-d o+ 321@@)
Q51)1 Ees.

Q51)) *hat do ,o0 do to reso-ve &OC/: error / 7&
5
M.MALLIKARJUNA RAO
Q51) Basi1a--, ,o0 need to 1orre1ting the o++ending data. Man, times the reason +or
&OC: is an 0n/initia-iPed n0meri1 item.
"Famine that possi.i-it, +irst. Man, insta--ations provide ,o0 a d0mp +or r0n time
a.endQs 2 it 1an .e generated a-so
., 1a--ing some s0.ro0tines or O& servi1es thr0 assem.-, -ang0age). #hese d0mps
provide the o++set o+ the -ast
instr01tion at Bhi1h the a.end o110rred. "Famine the 1ompi-ation o0tp0t 3R"$
-isting to get the ver. and the -ine
n0m.er o+ the so0r1e 1ode at this o++set. #hen ,o0 1an -oo? at the so0r1e 1ode to
+ind the .0g. #o get 1apt0re the
r0ntime d0mps' ,o0 Bi-- have to de+ine some datasets 2&E&ABOU# et1 ) in the
JCL. I+ none o+ these are he-p+0-' 0se
O0dgement and !I&(LAE to -o1a-iPe the so0r1e o+ error. &ome insta--ation might
have .at1h program de.0gging
too-s. Use them.

Q5)) AoB is sign stored in (a1?ed !e1ima- +ie-ds and 6oned !e1ima- +ie-ds
Q5)) (a1?ed !e1ima- +ie-dsG &ign is stored as a heF va-0e in the -ast ni..-e 29
.its ) o+ the storage.
6oned !e1ima- +ie-dsG As a de+a0-t' sign is over p0n1hed Bith the n0meri1
va-0e stored in the -ast .ite.

Q55) AoB is sign stored in a 1omp/5 +ie-d / 7&
Q55) It is stored in the -ast ni..-e. $or eFamp-e i+ ,o0r n0m.er is C1@@' it stores heF
@C in the -ast .,te' heF 1C i+
,o0r n0m.er is 1@1' heF )C i+ ,o0r n0m.er is 1@)' heF 1! i+ the n0m.er is /1@1'
heF )! i+ the n0m.er is /1@) et1...

Q59) AoB is sign stored in a COM( +ie-d / 7&
Q59) In the most signi+i1ant .it. Bit is ON i+ /ve' O$$ i+ Cve.

Q5<) *hat is the di++eren1e .etBeen COM( 8 COM(/5
Q5<) COM( is a .inar, storage +ormat Bhi-e COM(/5 is pa1?ed de1ima- +ormat.

Q5>) *hat is COM(/1 COM(/)
Q5>) COM(/1 / &ing-e pre1ision +-oating point. Uses 9 .,tes.
COM(/) / !o0.-e pre1ision +-oating point. Uses = .,tes.

Q5:) AoB do ,o0 de+ine a varia.-e o+ COM(/1 COM(/)
Q5:) No pi1t0re 1-a0se to .e given. "Famp-e @1 *&/%AR U&A7" COM(/1.

Q5=) AoB man, .,tes does a &42:) COM(/5 +ie-d o110p,
Q5=) *i-- ta?e 9 .,tes. &ign is stored as heF va-0e in the -ast ni..-e. 7enera-
+orm0-a is IN#22nD)) C 1))' Bhere nI: in this
eFamp-e.

Q54) AoB man, .,tes does a &42:) &I7N #RAILIN7 &"(ARA#" +ie-d o110p,
Q54) *i-- o110p, = .,tes 2one eFtra .,te +or sign).

Q9@) AoB man, .,tes Bi-- a &42=) COM( +ie-d o110p,
Q9@) 9 .,tes.

Q91) *hat is the maFim0m va-0e that 1an .e stored in &42=) COM(
Q91) 44444444

Q9)) *hat is COM( &ENC
Q9)) Ca0ses the item to .e a-igned on nat0ra- .o0ndaries. Can .e
&ENCARONI6"! L"$# or RI7A#. $or .inar, data
items' the address reso-0tion is +aster i+ the, are -o1ated at Bord .o0ndaries in the
memor,. $or eFamp-e' on main
+rame the memor, Bord siPe is 9 .,tes. #his means that ea1h Bord Bi-- start +rom
an address divisi.-e ., 9. I+ m,
+irst varia.-e is F25) and neFt one is s429) 1omp' then i+ ,o0 do not spe1i+, the
&ENC 1-a0se' &429) COM( Bi-- start
9
M.MALLIKARJUNA RAO
+rom .,te 5 2 ass0ming that it starts +rom @ ). I+ ,o0 spe1i+, &ENC' then the .inar,
data item Bi-- start +rom address 9.
Eo0 might see some Bastage o+ memor,' .0t the a11ess to this 1omp0tationa- +ie-d
is +aster.


Q95) *hat is the maFim0m siPe o+ a @1 -eve- item in COBOL I in COBOL II
Q95) In COBOL IIG 1>:::)1<

Q99) AoB do ,o0 re+eren1e the +o--oBing +i-e +ormats +rom COBOL programsG
Q99)
$iFed B-o1? $i-e / Use OR7ANI&A#ION I& &"QU"N#IAL. Use
R"COR!IN7 MO!" I& $'
BLOCK CON#AIN& @ .
$iFed Un.-o1?ed / Use OR7ANI&A#ION I& &"QU"N#IAL. Use
R"COR!IN7 MO!" I& $'
do not 0se BLOCK CON#AIN&
%aria.-e B-o1? $i-e / Use OR7ANI&A#ION I& &"QU"N#IAL. Use
R"COR!IN7 MO!" I& %' BLOCK
CON#AIN& @. !o not 1ode the 9 .,tes +or re1ord -ength in
$! ie JCL re1 -ength Bi-- .e maF re1 -ength in pgm C 9
%aria.-e Un.-o1?ed / Use OR7ANI&A#ION I& &"QU"N#IAL. Use
R"COR!IN7 MO!" I& %' do not 0se
BLOCK CON#AIN&. !o not 1ode 9 .,tes +or re1ord
-ength in $! ie JCL re1 -ength Bi--
.e maF re1 -ength in pgm C 9.
"&!& %&AM +i-e / Use OR7ANI&A#ION I& &"QU"N#IAL.
K&!& %&AM +i-e / Use OR7ANI&A#ION I& IN!"3"!' R"COR! K"E I&'
AL#"RNA#" R"COR! K"E I& RR!& $i-e / Use OR7ANI&A#ION I&
R"LA#I%"' R"LA#I%" K"E I&
(rinter $i-e / Use OR7ANI&A#ION I& &"QU"N#IAL. Use
R"COR!IN7 MO!" I& $' BLOCK
CON#AIN& @. 2Use R"C$MI$BA in JCL !CB).

Q9<) *hat are di++erent +i-e O("N modes avai-a.-e in COBOL
Q9<) Open +or IN(U#' OU#(U#' I/O' "3#"N!.

Q9>) *hat is the mode in Bhi1h ,o0 Bi-- O("N a +i-e +or Briting / 7&
Q9>) OU#(U#' "3#"N!

Q9:) In the JCL' hoB do ,o0 de+ine the +i-es re+erred to in a s0.ro0tine
Q9:) &0pp-, the !! 1ards O0st as ,o0 Bo0-d +or +i-es re+erred to in the main
program.

Q9=) Can ,o0 R"*RI#" a re1ord in an "&!& +i-e Can ,o0 !"L"#" a re1ord
+rom it
Q9=) Can reBrite 2re1ord -ength m0st .e same)' .0t not de-ete.

Q94) *hat is +i-e stat0s 4) / 7&
Q94) Logi1 error. e.g.' a +i-e is opened +or inp0t and an attempt is made to Brite to it.

Q<@) *hat is +i-e stat0s 54
Q<@) Mismat1h in LR"CL or BLOCK&I6" or R"C$M .etBeen ,o0r COBOL pgm
8 the JCL 2or the dataset -a.e-). Eo0
Bi-- get +i-e stat0s 54 on an O("N.

Q<1) *hat is &tati1 and !,nami1 -in?ing
Q<1) In stati1 -in?ing' the 1a--ed s0.ro0tine is -in?/edited into the 1a--ing program '
Bhi-e in d,nami1 -in?ing' the s0.ro0tine 8 the main program Bi-- eFist as separate
-oad mod0-es. Eo0 1hoose stati1Dd,nami1 -in?ing ., 1hoosing either the !ENAM or
NO!ENAM -in? edit option. 2"ven i+ ,o0 1hoose NO!ENAM' a CALL identi+ier
2as opposed to a CALL -itera-)' Bi-- trans-ate to a !ENAMIC 1a--).A stati1a--, 1a--ed
s0.ro0tine Bi-- not .e in its initia- state the neFt time it is 1a--ed 0n-ess ,o0 eFp-i1it-,
<
M.MALLIKARJUNA RAO
0se INI#IAL or ,o0 do a CANC"L. A d,nami1a--, 1a--ed ro0tine Bi-- a-Ba,s .e in
its initia- state.


Q<)) *hat is AMO!"2)9)' AMO!"251)' RMO!"2)9) and RMO!"2ANE)
2app-i1a.-e to on-, M%&D"&A
"nterprise &erver).
Q<)) #hese are 1ompi-eD-in? edit options. Basi1a--, AMO!" stands +or Addressing
mode and RMO!" +or Residen1,
mode.
AMO!"2)9) / )9 .it addressingJ
AMO!"251) / 51 .it addressing
AMO!"2ANE) / "ither )9 .it or 51 .it addressing depending on RMO!".
RMO!"2)9) / Resides in virt0a- storage .e-oB 1> Meg -ine. Use this +or 51 .it
programs that 1a-- )9 .it programs.
2O&D%& Co.o- pgms 0se )9 .it addresses on-,).
RMO!"2ANE) / Can reside a.ove or .e-oB 1> Meg -ine.

Q<5) *hat 1ompi-er option Bo0-d ,o0 0se +or d,nami1 -in?ing
Q<5) !ENAM.

Q<9) *hat is &&RAN7"' NO&&RAN7"
Q<9) #hese are 1ompi-er options Bith respe1t to s0.s1ript o0t o+ range 1he1?ing.
NO&&RAN7" is the de+a0-t and i+ 1hosen'
no r0n time error Bi-- .e +-agged i+ ,o0r indeF or s0.s1ript goes o0t o+ the
permissi.-e range.

Q<<) AoB do ,o0 set a ret0rn 1ode to the JCL +rom a COBOL program
Q<<) Move a va-0e to R"#URN/CO!" register. R"#URN/CO!" sho0-d not .e
de1-ared in ,o0r program.

Q<>) AoB 1an ,o0 s0.mit a Oo. +rom COBOL programs
Q<>) *rite JCL 1ards to a dataset Bith DDFFFFFFF &E&OU#I 2A'IN#R!R) Bhere
HAH is o0tp0t 1-ass' and dataset sho0-d .e
opened +or o0tp0t in the program. !e+ine a =@ .,te re1ord -a,o0t +or the +i-e.

Q<:) *hat are the di++eren1es .etBeen O& %& COBOL and %& COBOL II
Q<:) O&D%& Co.o- pgms 1an on-, r0n in )9 .it addressing mode' %& Co.o- II pgms
1an r0n either in )9 .it or 51 .it
addressing modes.

I. Report Briter is s0pported on-, in O&D%& Co.o-.
II. U&A7" I& (OIN#"R is s0pported on-, in %& COBOL II.
III. Re+eren1e modi+i1ation e.g.G *&/%AR21G)) is s0pported on-, in %&
COBOL II.
I%. "%ALUA#" is s0pported on-, in %& COBOL II.
%. &1ope terminators are s0pported on-, in %& COBOL II.
%I. O&D%& Co.o- +o--oBs AN&I :9 stds Bhi-e %& COBOL II +o--oBs AN&I
=< stds.
%II. Under CIC& Ca--s .etBeen %& COBOL II programs are s0pported.

Q<=) *hat are the steps ,o0 go thro0gh Bhi-e 1reating a COBOL program
eFe10ta.-e
Q<=) !B) pre1ompi-er 2i+ em.edded &QL 0sed)' CIC& trans-ator 2i+ CIC& pgm)'
Co.o- 1ompi-er' Lin? editor. I+ !B)
program' 1reate p-an ., .inding the !BRMs.

Q<4) Can ,o0 1a-- an O& %& COBOL pgm +rom a %& COBOL II pgm
Q<4) In non/CIC& environment' it is possi.-e. In CIC&' this is not possi.-e.

Q>@) *hat are the di++eren1es .etBeen COBOL and COBOL II
A>@) #here are at -east +ive di++eren1esG
COBOL II s0pports str01t0red programming ., 0sing in -ine (er+orms and eFp-i1it
s1ope terminators' It introd01es
>
M.MALLIKARJUNA RAO
neB +eat0res 2"%ALUA#"' &"#. #O #RU"' CALL. BE CON#"3#' et1) It
permits programs to .e -oaded and
addressed a.ove the 1>/mega.,te -ine It does not s0pport man, o-d +eat0res
2R"A!E #RAC"' R"(OR#/*RI#"R'
I&AM' "t1.)' and It o++ers enhan1ed CIC& s0pport.

Q>1) *hat is an eFp-i1it s1ope terminator
A>1) A s1ope terminator .ra1?ets its pre1eding ver.' e.g. I$ .. "N!/I$' so that a--
statements .etBeen the ver. and its s1ope terminator are gro0ped together. Other
1ommon COBOL II ver.s are R"A!' ("R$ORM' "%ALUA#"' &"ARCA and
&#RIN7.

Q>)) *hat is an in -ine ("R$ORM *hen Bo0-d ,o0 0se it An,thing e-se to sa,
a.o0t it
A>)) #he ("R$ORM and "N!/("R$ORM statements .ra1?et a-- COBOL II
statements .etBeen them. #he COBOL e;0iva-ent is to ("R$ORM or ("R$ORM
#ARU a paragraph. In -ine ("R$ORMs Bor? as -ong as there are no interna- 7O
#Os' not even to an eFit. #he in -ine ("R$ORM +or reada.i-it, sho0-d not eF1eed a
page -ength / o+ten it Bi-- re+eren1e other ("R$ORM paragraphs.

Q>5) *hat is the di++eren1e .etBeen N"3# &"N#"NC" and CON#INU"
A>5) N"3# &"N#"NC" gives 1ontro- to the ver. +o--oBing the neFt period.
CON#INU" gives 1ontro- to the neFt ver. a+ter the eFp-i1it s1ope terminator. 2#his
is not one o+ COBOL IIHs +iner imp-ementations). ItHs sa+est to 0se CON#INU"
rather than N"3# &"N#"NC" in COBOL II.

Q>9) *hat COBOL 1onstr01t is the COBOL II "%ALUA#" meant to rep-a1e
A>9) "%ALUA#" 1an .e 0sed in p-a1e o+ the nested I$ #A"N "L&" statements.

Q><) *hat is the signi+i1an1e o+ Ha.ove the -ineH and H.e-oB the -ineH
A><) Be+ore IBM introd01ed M%&D3A ar1hite1t0re in the 14=@Hs a programHs
virt0a- storage Bas -imited to 1> megs. (rograms 1ompi-ed Bith a )9 .it mode 1an
on-, address 1> M. o+ spa1e' as tho0gh the, Bere ?ept 0nder an imaginar, storage
-ine. *ith COBOL II a program 1ompi-ed Bith a 51 .it mode 1an .e Ha.ove the 1>
M. -ine. 2#his H.e-oB the -ineH' Ha.ove the -ineH imager, 1on+0ses most main+rame
programmers' Bho tend to .e a -itera- minded gro0p.)

Q>>) *hat Bas removed +rom COBOL in the COBOL II imp-ementation
A>>) (artia- -istG R"MARK&' NOMINAL K"E' (A7"/COUN#"R'
CURR"N#/!AE' #IM"/O$/!AE' &#A#"' $LO*' COUN#' "3AMIN"'
"3AIBI#' R"A!E #RAC" and R"&"# #RAC".

Q>:) "Fp-ain 1a-- ., 1onteFt ., 1omparing it to other 1a--s.
A>:) #he parameters passed in a 1a-- ., 1onteFt are prote1ted +rom modi+i1ation
., the 1a--ed program. In a norma- 1a-- the, are a.-e to .e modi+ied.

Q>=) *hat is the -in?age se1tion
A>=) #he -in?age se1tion is part o+ a 1a--ed program that H-in?sH or maps to data
items in the 1a--ing programHs Bor?ing storage. It is the part o+ the 1a--ed program
Bhere these share items are de+ined.

Q>4) *hat is the di++eren1e .etBeen a s0.s1ript and an indeF in a ta.-e de+inition
A>4) A s0.s1ript is a Bor?ing storage data de+inition item' t,pi1a--, a (IC 2444)
Bhere a va-0e m0st .e moved to the s0.s1ript and then in1remented or de1rements
., A!! #O and &UB#RAC# $ROM statements. An indeF is a register item that
eFists o0tside the programHs Bor?ing storage. Eo0 &"# an indeF to a va-0e and
&"# it U( BE va-0e and !O*N BE va-0e.

Q:@) I+ ,o0 Bere passing a ta.-e via -in?age' Bhi1h is pre+era.-e / a s0.s1ript or an
indeF
A:@) *a?e 0p / ,o0 havenHt .een pa,ing attentionN ItHs not possi.-e to pass an
indeF via -in?age. #he indeF is not part o+ the 1a--ing programs Bor?ing storage.
#hose o+ 0s BhoHve made this mista?e' appre1iate the -esson more than others.

:
M.MALLIKARJUNA RAO
Q:1) "Fp-ain the di++eren1e .etBeen an interna- and an eFterna- sort' the pros and
1ons' interna- sort s,ntaF et1.
A:1) An eFterna- sort is not COBOLJ it is per+ormed thro0gh JCL and
(7MI&OR#. It is 0nderstanda.-e Bitho0t an, 1ode re+eren1e. An interna- sort 1an
0se tBo di++erent s,ntaFQsG 1.) U&IN7' 7I%IN7 sorts are 1ompara.-e to eFterna-
sorts Bith no eFtra +i-e pro1essingJ )) IN(U# (ROC"!UR"' OU#(U#
(ROC"!UR" sorts a--oB +or data manip0-ation .e+ore andDor a+ter the sort.

Q:)) *hat is the di++eren1e .etBeen 1omp and 1omp/5 0sage "Fp-ain other
COBOL 0sageQs.
A:)) Comp is a .inar, 0sage' Bhi-e 1omp/5 indi1ates pa1?ed de1ima-. #he other
1ommon 0sageQs are .inar, and disp-a,. !isp-a, is the de+a0-t.

Q:5) *hen is a s1ope terminator mandator,
A:5) &1ope terminators are mandator, +or in/-ine ("R$ORM& and "%ALUA#"
statements. $or reada.i-it,' itHs re1ommended 1oding pra1ti1e to a-Ba,s ma?e
s1ope terminators eFp-i1it.

Q:9) In a COBOL II ("R$ORM statement' Bhen is the 1onditiona- tested' .e+ore or
a+ter the per+orm eFe10tion
A:9) In COBOL II the optiona- 1-a0se *I#A #"&# B"$OR" or *I#A #"&#
A$#"R 1an .e added to a-- per+orm statements. B, de+a0-t the test is per+ormed
.e+ore the per+orm.

Q:<) In an "%ALU#" statement is the order o+ the *A"N 1-a0ses signi+i1ant
A:<) A.so-0te-,. "va-0ation o+ the *A"N 1-a0ses pro1eeds +rom top to .ottom
and their se;0en1e 1an determine res0-ts.

Q:>) *hat is the de+a0-t va-0e2s) +or an INI#IALI6" and Bhat ?e,Bord a--oBs +or
an override o+ the de+a0-t.
A:>) INI#IALI6" moves spa1es to a-pha.eti1 +ie-ds and Peros to a-phan0meri1
+ie-ds. #he R"(LACIN7 option 1an .e 0sed to override these de+a0-ts.

Q::) *hat is &"# #O #RU" a-- a.o0t' an,Ba,
A::) In COBOL II the == -eve-s 1an .e set rather than moving their asso1iated
va-0es to the re-ated data item. 2*e. noteG #his 1hange is not one o+ COBOL IIHs
.etter spe1i+i1ations.)

Q:=) *hat is L"N7#A in COBOL II
A:=) L"N7#A a1ts -i?e a spe1ia- register to te-- the -ength o+ a gro0p or e-ementar,
item.

Q:4) *hat is the di++eren1e .etBeen a .inar, sear1h and a se;0entia- sear1h *hat
are the pertinent COBOL
1ommands
A:4) In a .inar, sear1h the ta.-e e-ement ?e, va-0es m0st .e in as1ending or
des1ending se;0en1e. #he ta.-e is Hha-vedH to sear1h +or e;0a- to' greater than or
-ess than 1onditions 0nti- the e-ement is +o0nd. In a se;0entia- sear1h the ta.-e is
sear1hed +rom top to .ottom' so 2ironi1a--,) the e-ements do not have to .e in a
spe1i+i1 se;0en1e. #he .inar, sear1h is m01h +aster +or -arger ta.-es' Bhi-e
se;0entia- Bor?s Be-- Bith sma--er ones. &"ARCA ALL is 0sed +or .inar,
sear1hesJ &"ARCA +or se;0entia-.

Q=@) *hat is the point o+ the R"(LACIN7 option o+ a 1op, statement
A=@) R"(LACIN7 a--oBs +or the same 1op, to .e 0sed more than on1e in the
same 1ode ., 1hanging the rep-a1e va-0e.

Q=1) *hat Bi-- happen i+ ,o0 1ode 7O BACK instead o+ &#O( RUN in a stand
a-one COBOL program i.e. a
program Bhi1h is not 1a--ing an, other program.
A=1) #he program Bi-- go in an in+inite -oop.

Q=)) AoB 1an I te-- i+ a mod0-e is .eing 1a--ed !ENAMICALLE or
&#A#ICALLE
=
M.MALLIKARJUNA RAO
A=)) #he ONLE Ba, is to -oo? at the o0tp0t o+ the -in?age editor 2I"*L)or the
-oad mod0-e itse-+. I+ the mod0-e is .eing 1a--ed !ENAMICALLE then it Bi-- not
eFist in the main mod0-e' i+ it is .eing 1a--ed &#A#ICALLE then it Bi-- .e seen in
the -oad mod0-e. Ca--ing a Bor?ing storage varia.-e' 1ontaining a program name'
does not ma?e a !ENAMIC 1a--. #his t,pe o+ 1a--ing is ?noBn as IM(LICI#"
1a--ing as the name o+ the mod0-e is imp-ied ., the 1ontents o+ the Bor?ing storage
varia.-e. Ca--ing a program name -itera- 2CALL

Q=5) *hat is the di++eren1e .etBeen a !ENAMIC and &#A#IC 1a-- in COBOL.
A=5) #o 1orre1t an ear-ier ansBerG A-- 1a--ed mod0-es 1annot r0n standa-one i+
the, re;0ire program varia.-es passed to them via the LINKA7" se1tion.
!ENAMICa--, 1a--ed mod0-es are those that are not .o0nd Bith the 1a--ing
program at -in? edit time 2I"*L +or IBM) and so are -oaded +rom the program
-i.rar, 2Oo.-i. or step-i.) asso1iated Bith the Oo.. $or !ENAMIC 1a--ing o+ a
mod0-e the !ENAM 1ompi-er option m0st .e 1hosen' e-se the -in?age editor Bi--
not generate an eFe10ta.-e as it Bi-- eFpe1t 0 address reso-0tion o+ a-- 1a--ed
mod0-es. A &#A#ICa--, 1a--ed mod0-e is one that is .o0nd Bith the 1a--ing mod0-e
at -in? edit' and there+ore .e1omes part o+ the eFe10ta.-e -oad mod0-e.

Q=9) AoB ma, divisions are there in JCL/COBOL
A=9) &I3

Q=<) *hat is the p0rpose o+ Identi+i1ation !ivision
A=<) !o10mentation.

Q=>) *hat is the di++eren1e .etBeen (IC 4.44 and 4v44
A=>) (IC 4.44 is a $OUR/(O&I#ION +ie-d that a1t0a--, 1ontains a de1ima- point
Bhere as (IC 4v44 is #AR""/ (O&I#ION n0meri1 +ie-d Bith imp-ied or ass0med
de1ima- position.

Q=:) Bhat is (i1 4v44 Indi1ates
A=:) (IC#UR" 4v44 is a three position N0meri1 +ie-d Bith an imp-ied or ass0med
de1ima- point a+ter the +irst positionJ the v means an imp-ied de1ima- point.

Q==) *hat g0ide-ines sho0-d .e +o--oBed to Brite a str01t0red Co.o- prgHm
A==)
1) 0se Heva-0ateH stmt +or 1onstr01ting 1ases.
)) 0se s1ope terminators +or nesting.
5) 0se in -ine per+orm stmt +or Briting Hdo H 1onstr01tions.
9) 0se test .e+ore and test a+ter in the per+orm stmt +or Briting do/Bhi-e
1onstr01tions.

Q=4) Read the +o--oBing 1ode. @1 Bs/n pi1 42)) va-0e Pero. a/para move < to Bs/n.
per+orm ./para Bs/n times. ./para.
move 1@ to Bs/n. hoB man, times Bi-- ./para .e eFe10ted
A=4) < times on-,. it Bi-- not ta?e the va-0e 1@ that is initia-iPed in the -oop.

Q4@) *hat is the di++eren1e .etBeen &"ARCA and &"ARCA ALL *hat is more
e++i1ient
A4@) &"ARCA is a se;0entia- sear1h +rom the .eginning o+ the ta.-e. &"ARCA
ALL is a .inar, sear1h' 1ontin0a--, dividing the ta.-e in tBo ha-ves 0nti- a mat1h is
+o0nd. &"ARCA ALL is more e++i1ient +or ta.-es -arger than :@ items.

Q41) *hat are some eFamp-es o+ 1ommand terminators
A41) "N!/I$' "N!/"%ALUA#"

Q4)) *hat 1are has to .e ta?en to +or1e program to eFe10te a.ove 1> Meg -ine
A4)) Ma?e s0re that -in? option is AMO!"I51 and RMO!"IANE. Compi-e
option sho0-d never have &I6"2MA3). BU$&I6" 1an .e )K' e++i1ient eno0gh.
Q45) AoB do ,o0 s0.mit JCL via a Co.o- program
A45) Use a +i-e DDdd1 !! s,so0tI2M' intrdr)Brite ,o0r JCL to this +i-e. (- some on
tr, this o0t.

Q49) AoB to eFe10te a set o+ JCL statements +rom a COBOL program
4
M.MALLIKARJUNA RAO
A49) Using "3"C CIC& &(OOL *RI#"2var/name) "N!/"3"C 1ommand. var/
name is a COBOL host str01t0re 1ontaining JCL statements.

Q4<) 7ive some advantages o+ R"!"$IN"& 1-a0se.
A4<)
1. Eo0 1an R"!"$IN" a %aria.-e +rom one (IC#UR" 1-ass to another
(IC#UR" 1-ass ., 0sing the same memor,
-o1ation.
). B, R"!"$IN"& Be 1an INI#IALI&" the varia.-e in *ORKIN7/
&#ORA7" &e1tion itse-+.
5. *e 1an R"!"$IN" a &ing-e %aria.-e into so man, s0. varia.-es. 2#his
+a1i-it, is ver, 0se+0- in so-ving E)@@@
(ro.-em.)

Q4>) *hat is the di++eren1e .etBeen stati1 1a-- 8 !,nami1 1a--
A4>) In the 1ase o+ &tati1 1a--' the 1a--ed program is a stand/a-one program' it is an
eFe10ta.-e program. !0ring r0n time Be 1an 1a-- it in o0r 1a--ed program. As a.o0t
!,nami1 1a--' the 1a--ed program is not an eFe10ta.-e program it 1an eFe10ted
thro0gh the 1a--ed program

Q4:) *hat do ,o0 +ee- ma?es a good program
A4:) A program that +o--oBs a top doBn approa1h. It is a-so one that other
programmers or 0sers 1an +o--oB -ogi1a--, and is eas, to read and 0nderstand.

Q4=) AoB do ,o0 1ode Co.o- to a11ess a parameter that has .een de+ined in JCL
And do ,o0 1ode the (ARM
parameter on the "3"C -ine in JCL
A4=)
1) 0sing JCL Bith s,sin. DDs,sin dd Mhere 0 1ode the parameters2va-0e) to pass
in to 1o.o- program DM and in program
,o0 0se a11ept varia.-e name2one a11ept Bi-- read one roB)D.another Ba,.
)) in O1- 0sing parm statement eFG in eFe1 statement parmIHOohnH'HdavidH in
1o.o- pgm 0 have to 1ode -in?age se1tion in that +or +irst va-0e ,o0 1ode -ength
varia.-e and varia.-e name sa,' a.1 pi1 F29).it Bi-- ta?e Oohn inside to read neFt
va-0e 0 have to 1ode another varia.-e in the same Ba, a.ove mentioned.

Q44) *h, do Be 1ode &429) 1omp. Inspite o+ ?noBing 1omp/5 Bi-- o110p, -ess
spa1e.
A44) Aere s429)1omp is sma-- integer 'so tBo Bords e;0a- to 1 .,te so tota--, it
Bi-- o110p, ) .,tes29 Bords).here in s429) 1omp/5 as one Bord is e;0a- to 1D)
.,te.9 Bords e;0a- to ) .,tes and sign Bi-- o110p, 1D) .,te so tota--, it Bi-- o110p,
5 .,tes.

Q1@@) #he maFim0m n0m.er o+ dimensions that an arra, 1an have in COBOL/=<
is ///////////
A1@@) &"%"N in COBOL / =< and #AR"" in COBOL / =9

Q1@1) AoB do ,o0 de1-are a host varia.-e 2in COBOL) +or an attri.0te named
"mp/Name o+ t,pe %ARCAAR2)<)
A1@1)
@1 "M(/7R(.
94 "/L"N (IC &429) COM(.
94 "/NAM" (IC 32)<).

Q1@)) *hat is Comm
A1@)) COMM / AAL$ *OR! BINARE

Q1@5) !i++erentiate COBOL and COBOL/II. 2Most o+ o0r programs are Britten in
COBOLII' so' it is good to ?noB'
hoB' this is di++erent +rom COBOL)
A1@5) #he +o--oBing +eat0res are avai-a.-e Bith %& COBOL IIG
1. M%&D3A and M%&D"&A s0pport #he 1ompi-er and the o.Oe1t programs it
prod01es 1an .e r0n in either
)9/ or 51/.it addressing mode.
1@
M.MALLIKARJUNA RAO
). %MD3A and %MD"&A s0pport #he 1ompi-er and the o.Oe1t programs it
prod01es 1an .e r0n in either
)9/ or 51/.it addressing mode.
5. %&"D"&A s0pport #he 1ompi-er and the o.Oe1t programs it prod01es 1an .e
r0n 0nder %&"D"&A.

Q1@9) *hat is ("R$ORM *hat is %AREIN7 2More detai-s a.o0t these 1-a0ses)
A1@9) #he ("R$ORM statement is a (ROC"!UR" !I%I&ION statement
Bhi1h trans+ers 1ontro- to one or more spe1i+ied pro1ed0res and 1ontro-s as
spe1i+ied the n0m.er o+ times the pro1ed0res are eFe10ted. A+ter eFe10tion o+ the
spe1i+ied pro1ed0res is 1omp-eted 2i.e.' +or the appropriate n0m.er o+ times or
0nti- some spe1i+ied 1ondition is met)' 1ontro- is trans+erred to the neFt
eFe10ta.-e statement +o--oBing the ("R$ORM statement. #here are < t,pes o+
("R$ORM statementsG
a) Basi1 ("R$ORM
.) ("R$ORM #IM"&
1) ("R$ORM UN#IL
d) ("R$ORM %AREIN7
e) IN/LIN" ("R$ORM

Q1@<) AoB man, se1tions are there in data division.
A1@<) &I3 &"C#ION& 1.$IL" &"C#ION ).*ORKIN7/&#ORA7"
&"C#ION 5. LOCAL/&#ORA7" &"C#ION 9.&CR""N &"C#ION <.R"(OR#
&"C#ION >. LINKA7" &"C#ION

Q1@>) *hat is Rede+ines 1-a0se
A1@>) Rede+ines 1-a0se is 0sed to a--oB the same storage a--o1ation to .e
re+eren1ed ., di++erent data names .

11

You might also like