<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Technical Interview Questions &#187; COBOL Interview Questions</title>
	<atom:link href="http://www.technicalinterview.info/category/cobol-interview-questions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.technicalinterview.info</link>
	<description>Java Interview Questions &#124; IT interview questions &#124; Software Testing Interview questions &#124; .Net Interview Questions &#124; Job Interview Questions &#38; Answers &#124; Tough Interview Questions &#124; Technology Interview Questions &#124; Tech Interview Questions &#124; Testing Interview Questions &#124; SAP Interview Questions &#124; ABAP Interview Questions &#124; Data Warehousing Interview Questions</description>
	<pubDate>Tue, 02 Sep 2008 08:33:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Cobol Interview Questions</title>
		<link>http://www.technicalinterview.info/cobol-interview-questions-3/</link>
		<comments>http://www.technicalinterview.info/cobol-interview-questions-3/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:25:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[COBOL Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/cobol-interview-questions-3/</guid>
		<description><![CDATA[1. When would you use in-line perform?
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 para [...]]]></description>
			<content:encoded><![CDATA[<p>1. When would you use in-line perform?</p>
<p>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 para name rather than in-line perform.</p>
<p>2. What is the difference between CONTINUE &#038; NEXT SENTENCE ?</p>
<p>CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)</p>
<p>3. What does EXIT do ?</p>
<p>Does nothing ! If used, must be the only sentence within a paragraph.</p>
<p>4. Can I redefine an X(100) field with a field of X(200)?</p>
<p>Yes. Redefines just causes both fields to start at the same location. For example:<br />
01 WS-TOP PIC X(1)<br />
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).<br />
If you MOVE &#8216;12&#8242; to WS-TOP-RED,<br />
DISPLAY WS-TOP will show 1 while<br />
DISPLAY WS-TOP-RED will show 12.</p>
<p>5. Can I redefine an X(200) field with a field of X(100) ?</p>
<p>Yes.</p>
<p>6. What do you do to resolve SOC-7 error?</p>
<p>Basically you need to correcting the offending data.<br />
Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.<br />
Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services through 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.<br />
If none of these are helpful, use judgment and DISPLAY to localize the source of error.<br />
Some installation might have batch program debugging tools. Use them.</p>
<p>7. How is sign stored in Packed Decimal fields and Zoned Decimal fields?</p>
<p>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.</p>
<p>8. How is sign stored in a comp-3 field?</p>
<p>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&#8230;</p>
<p>9. How is sign stored in a COMP field ?</p>
<p>In the most significant bit. Bit is on if -ve, off if +ve.</p>
<p>10. What is the difference between COMP &#038; COMP-3 ?</p>
<p>COMP is a binary storage format while COMP-3 is packed decimal format.</p>
<p>11. What is COMP-1? COMP-2?</p>
<p>COMP-1 - Single precision floating point. Uses 4 bytes.<br />
COMP-2 - Double precision floating point. Uses 8 bytes.</p>
<p>12. How do you define a variable of COMP-1? COMP-2?</p>
<p>No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.</p>
<p>13. How many bytes does a S9(7) COMP-3 field occupy ?</p>
<p>Will take 4 bytes. Sign is stored as hex value in the last nibble.<br />
General formula is INT((n/2) + 1)), where n=7 in this example.</p>
<p>14. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?</p>
<p>Will occupy 8 bytes (one extra byte for sign).</p>
<p>15. How many bytes will a S9(8) COMP field occupy ?</p>
<p>4 bytes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/cobol-interview-questions-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cobol Interview Questions</title>
		<link>http://www.technicalinterview.info/cobol-interview-questions-2/</link>
		<comments>http://www.technicalinterview.info/cobol-interview-questions-2/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:22:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[COBOL Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/cobol-interview-questions-2/</guid>
		<description><![CDATA[1. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.
Syntax:
SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;.
USING file-2
GIVING file-3.
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.
file-1 is the sort workfile and must be described using SD [...]]]></description>
			<content:encoded><![CDATA[<p>1. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.</p>
<p>Syntax:<br />
SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;.<br />
USING file-2<br />
GIVING file-3.<br />
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2<br />
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.<br />
file-1 is the sort workfile and must be described using SD entry in FILE SECTION.<br />
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.<br />
file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.<br />
file-1, file-2 &#038; file-3 should not be opened explicitly.<br />
INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.<br />
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.</p>
<p>2.How do you define a sort file in JCL that runs the COBOL program?</p>
<p>Use the SORTWK01, SORTWK02,&#8230;.. dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.</p>
<p>3.What are the two ways of doing sorting in a COBOL program? Give the formats.</p>
<p>Use the SORTWK01, SORTWK02</p>
<p>4.Give the format of USING and GIVING in SORT statement. What are the restrictions with it?</p>
<p>Restrictions - Cannot massage records, cannot select records to be sorted.</p>
<p>5. What is the difference between performing a SECTION and a PARAGRAPH?</p>
<p>Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.<br />
Performing a PARAGRAPH will cause only that paragraph to be performed.</p>
<p>6.What is the use of EVALUATE statement?</p>
<p>Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no &#8216;break&#8217; is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.</p>
<p>7. What are the different forms of EVALUATE statement?<br />
EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS<br />
WHEN A=B AND C=D WHEN 100 ALSO &#8216;00&#8242;<br />
imperative statement imperative statement<br />
WHEN (D+X)/Y = 4 WHEN -305 ALSO &#8216;32&#8242;<br />
imperative statement imperative statement<br />
WHEN OTHER WHEN OTHER<br />
imperative statement imperative statement<br />
END-EVALUATE END-EVALUATE<br />
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE<br />
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B<br />
imperative statement imperative statement<br />
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)<br />
imperative statement imperative statement<br />
END-EVALUATE END-EVALUATE</p>
<p>8. How do you come out of an EVALUATE statement?</p>
<p>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.</p>
<p>9.In an EVALUATE statement, can I give a complex condition on a when clause?</p>
<p>Yes.</p>
<p>10. What is a scope terminator? Give examples.</p>
<p>Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.</p>
<p>11. How do you do in-line PERFORM?</p>
<p>PERFORM &#8230; &#8230;<br />
END PERFORM</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/cobol-interview-questions-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cobol Interview Questions</title>
		<link>http://www.technicalinterview.info/cobol-interview-questions/</link>
		<comments>http://www.technicalinterview.info/cobol-interview-questions/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:17:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[COBOL Interview Questions]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/cobol-interview-questions/</guid>
		<description><![CDATA[1. Name the divisions in a COBOL program?
a.IDENTIFICATION DIVISION
b.ENVIRONMENT DIVISION
c.DATA DIVISION
d.PROCEDURE DIVISION.
2. What are the different data types available in COBOL?
Alpha-numeric (X),
alphabetic (A)
numeric (9).
3. What does the INITIALIZE verb do?
Alphabetic, Alphanumeric fields &#038; alphanumeric edited items are set to SPACES.
Numeric, Numeric edited items set to ZERO.
FILLER , OCCURS DEPENDING ON items left untouched.
4. What is [...]]]></description>
			<content:encoded><![CDATA[<p>1. Name the divisions in a COBOL program?</p>
<p>a.IDENTIFICATION DIVISION<br />
b.ENVIRONMENT DIVISION<br />
c.DATA DIVISION<br />
d.PROCEDURE DIVISION.</p>
<p>2. What are the different data types available in COBOL?</p>
<p>Alpha-numeric (X),<br />
alphabetic (A)<br />
numeric (9).</p>
<p>3. What does the INITIALIZE verb do?</p>
<p>Alphabetic, Alphanumeric fields &#038; alphanumeric edited items are set to SPACES.<br />
Numeric, Numeric edited items set to ZERO.<br />
FILLER , OCCURS DEPENDING ON items left untouched.</p>
<p>4. What is 77 level used for ?</p>
<p>Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.</p>
<p>5. What is 88 level used for ?</p>
<p>For condition names.</p>
<p>6. What is level 66 used for ?</p>
<p>For RENAMES clause.</p>
<p>7. What does the IS NUMERIC clause establish ?</p>
<p>IS NUMERIC can be used on alphanumeric items, signed numeric &#038; packed decimal items and unsigned numeric &#038; 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 - .</p>
<p>8. How do you define a table/array in COBOL?</p>
<p>01 ARRAYS.<br />
05 ARRAY1 PIC X(9) OCCURS 10 TIMES.<br />
05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.</p>
<p>9. Can the OCCURS clause be at the 01 level?</p>
<p>No.</p>
<p>10. What is the difference between index and subscript?</p>
<p>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 &#038; SET. Need to have index for a table in order to use SEARCH, SEARCH ALL.</p>
<p>11. What is the difference between SEARCH and SEARCH ALL?</p>
<p>SEARCH - is a serial search.<br />
SEARCH ALL - is a binary search &#038; the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used &#038; data loaded in this order) before using SEARCH ALL.</p>
<p>12. What should be the sorting order for SEARCH ALL?</p>
<p>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).</p>
<p>13.What is binary search?</p>
<p>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.</p>
<p>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?</p>
<p>Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/cobol-interview-questions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
