GeekInterview.com
Series: Subject: Topic:

COBOL Interview Questions

Showing Questions 1 - 20 of 232 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Consider two data items 77 w-a pic 9(3)v99 value 23.75 77 w-b pic zz9v99 value 123.45 after the statement move w-a to w-b what will be w-b value? A.123.75 b.B23.75 (where b indicates space) c.023.75...

Asked By: Interview Candidate | Asked On: Aug 20th, 2002

Answered by: Lalit Pant on: Jul 10th, 2014

Option b

Answered by: Rishi Sharma on: Jun 11th, 2014

Sorry Shashi and Soumya but this will work and answer would be B

What is linkage section? Can we use this concept when there's no called program?

Asked By: Suganj | Asked On: Apr 20th, 2007

Answered by: Rishi Sharma on: Jun 11th, 2014

You can certainly declare the variables in Linkage section even if you are not using them to call any external program. it wont result in error, but anyhow they wont get populated unless u receive data into them or populate them yourself to pass data to some called program.

I hope this helps !!!

Answered by: vidhya on: May 10th, 2013

When there is PARM passed from JCL, we need Linkage Section in COBOL program even when there is no called program.

Use of comp fields?

Asked By: clrMFint | Asked On: Feb 20th, 2014

Is there any use of using comp fields other than betwee space utilization?

Answered by: Rohit Dwivedi on: Jun 3rd, 2014

For getting precision in the mathematical calculation the Comp variables provide more precisions as well rather than simple Numeric and Decimal values

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.

Asked By: manoj | Asked On: Jul 21st, 2006

Answered by: Rishi Sharma on: May 22nd, 2014

Yes it can be done by following code:

Code
  1.  MOVE FUNCTION REVERSE(WS-String) TO WS-Reversed-String

Answered by: RAMESH on: Jul 3rd, 2012

by using reference modification...... IDENTIFICATION DIVISION. PROGRAM-ID. REVSTRN. ENVIRONMENT DIVISION. ...

What is difference between s9(04) comp and 9(04) comp? (cobol comp with s and without s)

Asked By: mannurusrinivasulareddy | Asked On: Sep 2nd, 2012

Answered by: Pradip Wagh on: Apr 17th, 2014

First is Binary storage and Second one is just Numeric storage.
Also, First will take 2 bytes of storage whereas Second one requires 4 Bytes of memory.

Correct me if I am wrong.!!!

Answered by: Chinnu Ann Jose on: Aug 21st, 2013

First one is binary and second one is numeric

How to remove the duplicate records present in a PS dataset using jcl?

Asked By: Radha | Asked On: Sep 13th, 2005

Answered by: Mahaveer on: Feb 1st, 2014

"c //SORTXSUM DD DSN=datasetname, // DISP=(NEW,CATLG,DELETE),UNIT=SYSDA, // SPACE=(CYL,(1,4),RLSE), // DCB=(RECFM=FBM,LERCL=80,BLKSIZE=800) . . //S...

Answered by: Raja on: Sep 25th, 2007

Hi,The XSUM parameter cannot be given with the sort card. It should be given in the SUM FIELDS card. You should write as follows://SYSIN  DD * SORT FIELDS=(40,6,PD,A) SUM FIELDS=NONE,XSUM/*

Called and calling program for cobol with cursor

Asked By: harish.jamkhande | Asked On: Jun 11th, 2012

I have program a which is calling b first time. B program is feaching data using cursor , but some mess happened and the control went back to pro a without closing cursor . Once again program a called program b then what will happen to cursor. Will program fetch the data.

Answered by: TJ on: Jan 22nd, 2014

I think it will throw SQL error code -502 i.e. when it will try to open the cursor that is already open.

Answered by: Latha on: Jul 16th, 2012

Program B will throw an error while it is trying to open the cursor again, which is already opened.

How will you analyze a cobol program?

Asked By: ankoo | Asked On: Oct 25th, 2012

Hi, i was asked in interview how would you analyze a cobol program? i gave the ans as there are many kind of analyses -: requirement analysis root cause analysis impact analysis problem / logic analysis but in general we talk about problem finding in a program and told him we would first go in for...

Answered by: abhishek on: Jan 21st, 2014

Local-Storage is allocated each time the program is called and is de-allocated when the program returns via an EXIT PROGRAM, GOBACK, or STOP RUN. Any data items with a VALUE clauses are initialized to...

Answered by: davindersingh29 on: May 17th, 2013

Second part of your answer seems satisfactory. You should have asked the interviewer for what we need to analyze, if its just for document purpose, then your answer is right. If its for a change, then there are specific areas we need to analyze for the changes impact.

What is set to true all about, anyway?

Asked By: Interview Candidate | Asked On: Sep 29th, 2004

In cobol ii the 88 levels can be set rather than moving their associated values to the related data item. (web note: this change is not one of cobol ii's better specifications.)

Answered by: Nath on: Sep 13th, 2013

@poojaDeep & @gilbat82, As you said, I have three doubts. 1. While starting execution of the program after declaring in working storage as you said, what are the initial values (TRUE or FALSE) are s...

Answered by: gilbat82 on: Jul 15th, 2008

Last answer is correct and below example also.e.g. 05  ACCOUNT-TYPE         PIC X(01) VALUE 'N'.        &nb...

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 ?

Asked By: Interview Candidate | Asked On: Aug 12th, 2005

Answered by: ashwini on: Sep 10th, 2013

Hi all, I run the program and it ran successfully. After moving : WS-B displays ABCD5 It means Movement has not been properly done .The previous values of A have not properly erased out plus the junk ...

Answered by: Vahida Syed on: Apr 7th, 2013

I tried implementing this in mainframes.. Neither it has given compilation error nor abended when executing the program.
Result is : both the fields holds "abcde".

C1 c2 c3 are three conditions whose truth values are as folloes. C1-true c2-false c3-true a,b,c are defined as given below a:c1 and(not c2) or c3 b.(not c1) or (not c2 and not c3) c.(c1 or c2)and...

Asked By: Interview Candidate | Asked On: Aug 20th, 2002

Answered by: Chinnu Ann Jose on: Aug 21st, 2013

B

Answered by: charanjeet kaur on: Jun 9th, 2013

A.C.D

What is local storage section in cobol ?

Asked By: dtiwar | Asked On: Sep 27th, 2011

Answered by: davindersingh29 on: May 17th, 2013

Just to add, my two cents: Data items in the LOCAL-STORAGE SECTION are automatically allocated for each instance of a program invocation. When a program runs in multiple threads simultaneously, each ...

Answered by: Toleshwar on: Mar 14th, 2013

Local storage section is a section of Data Division of Cobol which is similar to the Working storage section. The only difference being that the variables in the Local Storage always get initialised w...

What is difference between initialize and value?

Asked By: p.srinivas | Asked On: Aug 30th, 2006

Answered by: nagaraju on: Apr 30th, 2013

value : value clause is used to initialize values at working storage section only. i.e.., giving the values at declaration time initialize : this verb is used in 2 ways. 1) used to supply the init...

Answered by: talluri on: Jul 27th, 2011

INITIALIZE verb is used to refresh the alphabetic & alphanumeric empty fields with SPACES and numeric empty fields with ZEROS

What is the use of level 49 in cobol?

Asked By: LC Sharma | Asked On: Jan 12th, 2007

Answered by: snehali on: Apr 2nd, 2013

The level number 02 to 49 are use to specify the group and elementary data items within a record.

Answered by: Vaneeshkhurana on: Mar 21st, 2010

Although level 02-49 level are group or elementry elements but sometimes 49 are used for dynmic SQL, i.e.01 WS-SQl-statement1-VARIABLE.    49  WS-SQL-STATEMENT1-LEN  &nbs...

Prime number in cobol

Asked By: vijayjessy | Asked On: Aug 9th, 2012

Culd any body tell the concept for the prime number programe?

Answered by: Gunesh Asatkar on: Feb 13th, 2013

set the start and end limit from which prime will calculate. then start first for loop and second for loop. "cobol DATA DIVISION. WORKING-STORAGE SECTION. 77 I PIC 999 VALUE 001. ...

Answered by: drcobol on: Nov 26th, 2012

1. You dont need to loop further than the integer of the square root of the number in question
2. You can skip multiples of numbers already checked (if a number is not divisible by 2 then its not by 4 either)

Concatinating two rec by using cobol & jcl

Asked By: mannurusrinivasulareddy | Asked On: Sep 6th, 2012

I need to concatenate records by using cobol and jcl (both) as follows. input file: aaaaa bbbbb ccccc ddddd 11111 22222 33333 44444 split the file into two halves and 1st rec of first half and 2nd rec of second half records are concatinated and 2nd rec of first half and 2nd rec of second half records...

Answered by: Rajesh.chedhalla on: Sep 26th, 2012

1. Split the INPUT File into two halves and generate the SEQNUM for each record.
2. Then Join the two files on SEQNUM and Reformat the fields in required format.

Redefine

Asked By: rajcandoit | Asked On: Sep 20th, 2010

What is redefine in cobol?

Answered by: Karthik on: Sep 24th, 2012

Truncation happens from left to right.

Answered by: mannurusrinivasulareddy on: Sep 1st, 2012

Its Just like a type conversion If we are having a field in database as alphanumeric and we want to superate the $ symbol and superate the numeric value for calculation as follows ...

What will happen if a cursor is opened again before closing?

Asked By: Manish Lalwani | Asked On: Sep 13th, 2007

A cursor is opened.After fetching few rows. It is opened again before closing it.What will be the result?

Answered by: mannurusrinivasulareddy on: Sep 1st, 2012

It give -502 error code i.e already the cursor was opened

Answered by: mf.vannan on: Jun 25th, 2010

If cursor is opened again before closing The error will be happen as Cursor already opened. Error code is 501Rgds Rasipuram Manivannan MContact: =91-9486115495 

Study the following 01 a pic 99v0 value 5 01 b pic 9v9 value 6 01 C pic 99v9 value 2.5 01 d pic 99 value 3 compute a rounded b C = a+b*c/d on size error perform print-error the comments of a.B.C...

Asked By: Interview Candidate | Asked On: Aug 20th, 2002

Answered by: Ashish on: Aug 23rd, 2012

Tested the prog actually on Mf

Ans is :
A B C :100 00 100

Answered by: shivanilal on: Apr 22nd, 2008

Answer is dc=10

Can redefines clause be used in file section, if yes at which level number ?

Asked By: Interview Candidate | Asked On: Sep 1st, 2005

Answered by: giriswamy on: Aug 17th, 2012

Except 66 and 88 levels it will work.

Answered by: BALASUKUMAR on: May 10th, 2012

Cant used redefines clause in file-section.

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.