<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>还是那只鱼-newcoin&#039;s blog &#187; cobol</title>
	<atom:link href="http://www.newcoin.info/tag/cobol/feed" rel="self" type="application/rss+xml" />
	<link>http://www.newcoin.info</link>
	<description>人生没有彩排，每天都是现场直播...</description>
	<lastBuildDate>Thu, 02 Feb 2012 12:51:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Efficiency Of A COBOL program</title>
		<link>http://www.newcoin.info/efficiency-of-a-cobol-program.html</link>
		<comments>http://www.newcoin.info/efficiency-of-a-cobol-program.html#comments</comments>
		<pubDate>Thu, 22 Sep 2011 04:47:43 +0000</pubDate>
		<dc:creator>newcoin</dc:creator>
				<category><![CDATA[大型机｜Mainframe]]></category>
		<category><![CDATA[cobol]]></category>
		<category><![CDATA[cobol 性能]]></category>
		<category><![CDATA[效能提高]]></category>
		<category><![CDATA[程序]]></category>

		<guid isPermaLink="false">http://www.newcoin.info/?p=29419</guid>
		<description><![CDATA[Efficiency Of A COBOL program Table of Contents 1. Introduction.. 3 2. VALUE clause. 4 3. 01 Double Boundary location.. 4 4. ALPHANUMERIC and COMP work fields. 4 5. DISPLAY NUMERIC work fields. 4 6. COMP-3 work fields. 4 7. OPEN/CLOSE file. 5 8. Internal Tables. 5 9. End of Document 5 1. Introduction This [...]]]></description>
			<content:encoded><![CDATA[<p>Efficiency Of A COBOL program</p>
<p><strong> </strong></p>
<p><strong>Table of Contents</strong></p>
<p><strong>1.</strong> <strong>Introduction</strong>.. 3</p>
<p><strong>2.</strong> <strong>VALUE clause</strong>. 4</p>
<p><strong>3.</strong> <strong>01 Double Boundary location</strong>.. 4</p>
<p><strong>4.</strong> <strong>ALPHANUMERIC and COMP work fields</strong>. 4</p>
<p><strong>5.</strong> <strong>DISPLAY NUMERIC work fields</strong>. 4</p>
<p><strong>6.</strong> <strong>COMP-3 work fields</strong>. 4</p>
<p><strong>7.</strong> <strong>OPEN/CLOSE file</strong>. 5</p>
<p><strong>8.</strong> <strong>Internal Tables</strong>. 5</p>
<p><strong>9.</strong> <strong>End of Document</strong> 5</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong><span id="more-29419"></span></strong><strong>1. </strong><strong>Introduction</strong><strong> </strong></p>
<p><strong> </strong></p>
<p>This document can be used by COBOL programmers and application designers as a guide to improve the performance of their programs and to improve the efficiency of their design. The tips are specific to COBOL 2 and above, but can be tried on lower versions too.</p>
<p>Incorporating the tips given in this document while coding, program size can be decreased by as much as 30% and the execution time can come down by as much as 40%. This however is not a benchmark and the values depend upon the rest of the code.</p>
<p>&nbsp;</p>
<ol>
<li><strong>2. </strong><strong>VALUE clause</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>As far as possible, one should avoid using the VALUE clause in the working storage section, while declaring variables. During the initialization process, the literals that had to be automatically defined in the, what we can call ‘Literal Pool’, are moved into the working storage fields. So why not do it ourselves? Use MOVE statement in your initialization paragraph. Although we cannot control the ‘Literal Pool’ definition, we can control the ‘group moves’ and thus achieve significant improvement in efficiency.</p>
<p>（source：<a href="http://www.newcoin.info">http://www.newcoin.info</a>)</p>
<ol>
<li><strong>3. </strong><strong>01 Double Boundary location</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>Create a few 01 level variables and then all your work fields as a lower level (say 05). If you have a 3 byte field and you declare it as 01 level, and you have another 01 level field following it, then 5 bytes of non referenced data is wasted. These slack bytes can also make things confusing when looking at the dump.</p>
<p>&nbsp;</p>
<ol>
<li><strong>4. </strong><strong>ALPHANUMERIC and COMP work fields</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>It is advisable to have all the alphanumeric work fields as 05 levels under a single 01 level. This way, the programmer can move SPACES to the 01 level and have the same effect as coding a VALUE SPACES clause on each field. The same is true for COMP fields. Just move LOW-VALUES to the 01 level instead of initializing or moving low values to each element separately. Here, INITIALIZE verb is to be avoided because it will generate a MOVE statement for each individual element.</p>
<p>&nbsp;</p>
<ol>
<li><strong>5. </strong><strong>DISPLAY NUMERIC work fields</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>When mathematical calculations are done on DISPLAY NUMERIC fields, then the compiler has to do extra work of converting the data into numeric format, manipulating it and then converting it back. Thus a lot of un-necessary instructions are generated and valuable space is lost for the ‘scratch pad’ to manipulate the data. Instead it is far better to use the data type meant for mathematical calculations and then moving the result to a DISPLAY NUMERIC variable. Similarly, avoid mathematical calculations with UNSIGNED NUMERIC fields. The compiler has to generate instructions to strip the sign out and thus extra ‘scratch pad’ area is required.</p>
<p><strong> </strong></p>
<ol>
<li><strong>6. </strong><strong>COMP-3 work fields</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>Since COMP-3 field is stored as a single digit in a nibble, with one nibble being taken up for the sign, every time we reference a COMP-3 field having even no of digits ( S9(4) ) the compiler has to generate extra code to strip out the higher order digit. Hence one should always use an odd no of digits while declaring COMP-3 fields.</p>
<p><strong> </strong></p>
<ol>
<li><strong>7. </strong><strong>OPEN/CLOSE file</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>The OPEN/CLOSE instruction generates a lot of excessive code, so the recommendation is to always open and close all the files at the same time. However one must keep in mind that the default no. of buffers in MVS is 5. So each file that is opened, consumes 5 times the block size in real memory. This means that less memory is available for the job as well as the jobs that are running. Thus division of resources becomes difficult for the OS. So it is better to open the control file, read the record and close it before proceeding to he main logic.</p>
<p>（source：<a href="../">http://www.newcoin.info</a>)</p>
<ol>
<li><strong>8. </strong><strong>Internal Tables</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
<p>An unsorted table search is not so bad for a very small table. But as the size of the table increases, the inefficiencies rise exponentially. Hence it is advisable to use SEARCH ALL to do a binary search on the table.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<ol>
<li><strong>9. </strong><strong>End of Document</strong><strong> </strong></li>
</ol>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newcoin.info/efficiency-of-a-cobol-program.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JCL/COBOL/DB2/CICS/VASM考试题</title>
		<link>http://www.newcoin.info/jclcoboldb2cicsvasm%e8%80%83%e8%af%95%e9%a2%98.html</link>
		<comments>http://www.newcoin.info/jclcoboldb2cicsvasm%e8%80%83%e8%af%95%e9%a2%98.html#comments</comments>
		<pubDate>Fri, 17 Apr 2009 09:21:10 +0000</pubDate>
		<dc:creator>newcoin</dc:creator>
				<category><![CDATA[大型机｜Mainframe]]></category>
		<category><![CDATA[CICS]]></category>
		<category><![CDATA[cobol]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IBM大型机]]></category>
		<category><![CDATA[JCL]]></category>
		<category><![CDATA[VASM]]></category>
		<category><![CDATA[大型机培训]]></category>
		<category><![CDATA[考试题库]]></category>

		<guid isPermaLink="false">http://www.newcoin.info/?p=27585</guid>
		<description><![CDATA[这些都是曾经我在参加大型机培训时做过的一些考试题目，特拿出来分享一下，主要是关于IBM大型机方面的知识，涉及到JCL/COBOL/DB2/CICS/VASM等方面，题目不多，但基本上都是重点，是必须得掌握的，有兴趣的可以拿去自测一下。不懂的可以问我，呵呵。 JCL Exam (60 Minutes) Name: _____________ Grade: ____________ 1. What is the difference between the JOBLIB and the STEPLIB statements? The position difference.joblib adapts whole job,steplib only exec. 2. Name some of the JCL statements that are not allowed in PROCs. Job statements,dd * statements,dd data statements,/*,null statements 3. What does a dispositions of (NEW,CATLG, KEEP) means? 4. What are three major types of JCL statements? What are their functions? Job,exec,dd statements. 5. What is the difference between catalogue procedure and In-Stream procedure? Position,调用member name,pro name, 6. What is a COND parameter in JCL? 1,position (exec,job)2, 7. How do you check the syntax of a JCL without running it? Typrun=scan 8. How do you override a specific DDNAME/SYSIN in PROC from a JCL? 调用时Dda  dsn=另外一个，dsn=,这样就是制空 9. A PROC has five steps.  Step 3 has a condition code.  How can you override or nullify this condition code? 指定到那个proc的作业步，cond(2,eq,),nullify用even 10. How do you create a temporary dataset?  Where will you use them? Dsn=&#38;&#38;    参数（new,pass,delete）下去的,这样就是temporary （http://www.newcoin.info) DB2 Exam (60 Minutes) Name: _____________ Grade: ____________ 1. How do you eliminate duplicate values in SELECT? 2. What do you accomplish by GROUP BY &#8230; HAVING clause? 3. Why SELECT * is not preferred in embedded SQL programs? 4. What is a cursor? Why should it be used? List the SQL statement for cursors. 5. What is a DB2 bind? 6. What is a host variable? How do you use it? 7. Is it mandatory to use DCLGEN? If not, why would you use it at all? 8. Give the COBOL definition of a VARCHAR field. 9. What does SQLCODE +100 means？ 10. How do you run DB2 batch program? Write down the JCL statements. （http://www.newcoin.info) VSAM Exam (60 Minutes) Name: _____________ Grade: ____________ 1. What are the four types of VSAM datasets? 2. What is a CI? 3. In the COBOL SELECT statement what is the ORGANIZATION for a KSDS? 4. What is the purpose of the FILE STATUS clause in the SELECT statement? 5. There are at least seven IDCAMS commands; name and explain each of them. 6. What is the meaning of each of the values in SHAREOPTS (2 3)? 7. How do you define a KSDS using IDCAMS? 8. How do you define an ALTINDX? How do you use ALTINDXs in batch, CICS programs? （http://www.newcoin.info) CICS Exam (60 Minutes) [...]]]></description>
			<content:encoded><![CDATA[<p>这些都是曾经我在参加大型机培训时做过的一些考试题目，特拿出来分享一下，主要是关于IBM大型机方面的知识，涉及到JCL/COBOL/DB2/CICS/VASM等方面，题目不多，但基本上都是重点，是必须得掌握的，有兴趣的可以拿去自测一下。不懂的可以问我，呵呵。</p>
<p><span id="more-27585"></span></p>
<p><strong>JCL Exam</strong></p>
<p>(60 Minutes)</p>
<p>Name: _____________								Grade: ____________</p>
<p>1. What is the difference between the JOBLIB and the STEPLIB statements?</p>
<p>The position difference.joblib adapts whole job,steplib only exec.</p>
<p>2. Name some of the JCL statements that are not allowed in PROCs.</p>
<p>Job statements,dd * statements,dd data statements,/*,null statements</p>
<p>3. What does a dispositions of (NEW,CATLG, KEEP) means?</p>
<p>4. What are three major types of JCL statements? What are their functions?</p>
<p>Job,exec,dd statements.</p>
<p>5. What is the difference between catalogue procedure and In-Stream procedure?</p>
<p>Position,调用member name,pro name,</p>
<p>6. What is a COND parameter in JCL?</p>
<p>1,position (exec,job)2,</p>
<p>7. How do you check the syntax of a JCL without running it?</p>
<p>Typrun=scan</p>
<p>8. How do you override a specific DDNAME/SYSIN in PROC from a JCL?</p>
<p>调用时Dda  dsn=另外一个，dsn=,这样就是制空</p>
<p>9. A PROC has five steps.  Step 3 has a condition code.  How can you override or nullify this condition code?</p>
<p>指定到那个proc的作业步，cond(2,eq,),nullify用even</p>
<p>10. How do you create a temporary dataset?  Where will you use them?</p>
<p>Dsn=&amp;&amp;    参数（new,pass,delete）下去的,这样就是temporary</p>
<p><a href="http://www.newcoin.info">（http://www.newcoin.info)</a></p>
<p><strong>DB2 Exam</strong></p>
<p>(60 Minutes)</p>
<p>Name: _____________								Grade: ____________</p>
<p>1. How do you eliminate duplicate values in SELECT?</p>
<p>2. What do you accomplish by GROUP BY &#8230; HAVING clause?</p>
<p>3. Why SELECT * is not preferred in embedded SQL programs?</p>
<p>4. What is a cursor? Why should it be used? List the SQL statement for cursors.</p>
<p>5. What is a DB2 bind?</p>
<p>6. What is a host variable? How do you use it?</p>
<p>7. Is it mandatory to use DCLGEN? If not, why would you use it at all?</p>
<p>8. Give the COBOL definition of a VARCHAR field.</p>
<p>9. What does SQLCODE +100 means？</p>
<p>10. How do you run DB2 batch program? Write down the JCL statements.</p>
<p><a href="http://www.newcoin.info">（http://www.newcoin.info)</a></p>
<div class="Section0">
<p><strong>VSAM Exam</strong></p>
<p>(60 Minutes)</p>
<p>Name: _____________								Grade: ____________</p>
<p>1. What are the four types of VSAM datasets?</p>
<p>2. What is a CI?</p>
<p>3. In the COBOL SELECT statement what is the ORGANIZATION for a KSDS?</p>
<p>4. What is the purpose of the FILE STATUS clause in the SELECT statement?</p>
<p>5. There are at least seven IDCAMS commands; name and explain each of them.</p>
<p>6. What is the meaning of each of the values in SHAREOPTS (2 3)?</p>
<p>7. How do you define a KSDS using IDCAMS?</p>
<p>8. How do you define an ALTINDX? How do you use ALTINDXs in batch, CICS programs?</p></div>
<div class="Section0"></div>
<div class="Section0"><a href="http://www.newcoin.info">（http://www.newcoin.info)</a></div>
<div class="Section0"></div>
<div class="Section0">
<p><strong>CICS Exam</strong></p>
<p>(60 Minutes)</p>
<p>Name: _____________								Grade: ____________</p>
<p>1. Specify the CICS command used to read a VSAM record starting with prefix &#8221;F&#8221;. Code all the relevant options.</p>
<p>2. What option is specified in the SEND command to send only the unnamed fields on to the screen? Give out the complete command.</p>
<p>3. What does &#8221;Pseudo Conversational&#8221; mean? What is the EIB parameter and the CICS command used to implement Pseudo-Conversational technique?</p>
<p>4. What are the differences between an EXEC CICS XCTL and an EXEC CICS LINK command?</p>
<p>5. Explain how to handle exceptional conditions in CICS. List at least four types and give detail description of them.</p>
<p>6. What are the differences between Temporary Storage Queue (TSQ) and Transient Data Queue (TDQ)?</p>
<p>7. what do the following transactions do?</p>
<p>CEDF:</p>
<p>CEMT:</p>
<p>CEBR:</p>
<p>CECI:</p>
<p>CESN:</p>
<p>CESF:</p>
<p>CEDA:</p>
<p>8. What is DFHEIBLK? List some items of it and describe these items&#8217; meaning.</p>
<p><a href="http://www.newcoin.info">（http://www.newcoin.info)</a></p>
<p><strong>COBOL Exam</strong></p>
<p>(60 Minutes)</p>
<p>Name: _____________								Grade: ____________</p>
<p>1. Name the four divisions in a COBOL program.</p>
<p>2. How do you define a table/array in COBOL? Give an example.</p>
<p>3. How do you sort in a COBOL program?  Give sort file definition, sort statement syntax and meaning.</p>
<p>4. What is the difference between comp and comp-3 usage? Explain other COBOL usages.</p>
<p>5. What is the difference between SEARCH and SEARCH ALL? What is more efficient?</p>
<p>6. What is PERFORM? What is VARYING? Give more details description about these clauses.</p>
<p>7. What is redefines clause? Give an example.</p>
<p>8. What is CALL statement in COBOL? List the different types of call.</p>
<p><a href="http://www.newcoin.info">（http://www.newcoin.info)</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.newcoin.info/jclcoboldb2cicsvasm%e8%80%83%e8%af%95%e9%a2%98.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>cobol考试自测题库</title>
		<link>http://www.newcoin.info/cobol%e8%80%83%e8%af%95%e8%87%aa%e6%b5%8b%e9%a2%98%e5%ba%93.html</link>
		<comments>http://www.newcoin.info/cobol%e8%80%83%e8%af%95%e8%87%aa%e6%b5%8b%e9%a2%98%e5%ba%93.html#comments</comments>
		<pubDate>Tue, 17 Mar 2009 09:22:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[大型机｜Mainframe]]></category>
		<category><![CDATA[cobol]]></category>
		<category><![CDATA[selftest]]></category>
		<category><![CDATA[大机]]></category>
		<category><![CDATA[文档资料]]></category>
		<category><![CDATA[考试]]></category>
		<category><![CDATA[自测]]></category>
		<category><![CDATA[题库]]></category>

		<guid isPermaLink="false">http://newcoin.info/?p=27301</guid>
		<description><![CDATA[QUESTIONS. 1. Which of the foolowing words is NOT e COBOL reserved word. O (a) RECORD O (b) INDEX O (c) DATA O (d) FILE 2. Which of the following words can NOT be used to perform calculations in a COBOL program. O (a) ASSIGN O (b) DIVIDE O (c) MULTIPLY O (d) ADD 3. [...]]]></description>
			<content:encoded><![CDATA[<p>QUESTIONS.<br />
1. Which of the foolowing words is NOT e COBOL reserved word.<br />
O (a) RECORD<br />
O (b) INDEX<br />
O (c) DATA<br />
O (d) FILE<br />
2. Which of the following words can NOT be used to perform calculations in a COBOL program.<br />
O (a) ASSIGN<br />
O (b) DIVIDE<br />
O (c) MULTIPLY<br />
O (d) ADD</p>
<p><span id="more-27301"></span><br />
3. A COBOL programmer wants to repeat an instruction 5 times. How can he/she code this?<br />
O (a)<br />
REPEAT 5 TIMES<br />
instructie<br />
END-REPEAT<br />
O (b)<br />
PERFORM 5 TIMES<br />
instructie<br />
END-PERFORM<br />
O (c)<br />
MOVE 1 TO COUNTER<br />
PERFORM UNTIL COUNTER = 5<br />
COMPUTE COUNTER = COUNTER + 1<br />
instructie<br />
END-PERFORM<br />
O (d)<br />
REPEAT VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER = 5<br />
instructie<br />
END-PERFORM<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 4<br />
4. Which of the following answers gives the divisions of a COBOL program in the right order.<br />
O (a) Environment &#8211; Identification &#8211; Data &#8211; Procedure<br />
O (b) Identification &#8211; Environment &#8211; Data &#8211; Procedure<br />
O (c) Identification &#8211; Environment &#8211; Procedure &#8211; Data<br />
O (d) Environment &#8211; Identification &#8211; Procedure &#8211; Data<br />
5. Which of the following variable names for data items are syntactically correct ? (2 answers)<br />
[_] [a] CITY-CODE<br />
[_] [b] -NR-OF-ITEMS<br />
[_] [c] TOTAL-NUMBER-OF-LINES-PER-TEST<br />
[_] [d] PRODUCT NUMBER<br />
[_] [e] INDEX<br />
6. When is the coding of a period obligatory ? (3 answers)<br />
[_] [a] after each 01 level of a variable declaration<br />
[_] [b] at the end of each instruction<br />
[_] [c] at the end of each paragraph<br />
[_] [d] at the end of the program<br />
[_] [e] to end an IF instruction<br />
7. Which of the following symbols can NOT be coded on position 7 of a COBOL program.<br />
O (a) -<br />
O (b) *<br />
O (c) /<br />
O (d) #<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 5<br />
8. Take a look at the following COBOL program. Assuming A, B, C, &#8230; are COBOL instructions,<br />
in which order will they be executed?<br />
MAIN-PAR.<br />
PERFORM INIT-PAR<br />
Z<br />
PERFORM TERM-PAR<br />
Z<br />
STOP RUN<br />
.<br />
INIT-PAR.<br />
A<br />
B<br />
PERFORM READ-X<br />
.<br />
LOOP-PAR.<br />
E<br />
F<br />
.<br />
TERM-PAR.<br />
G<br />
H<br />
.<br />
READ-X.<br />
X.<br />
O (a) A B Z E F Z X<br />
O (b) A B X Z E F G H Z X<br />
O (c) A B X Z E F Z G H Z<br />
O (d) A B X Z G H Z<br />
9. Take a look at the following calculation. If you take the normal priority rules in account, how will<br />
this calculation be executed ?<br />
A ** 2 * B / 2 + c &#8211; 5<br />
O (a) (((A ** 2) * B) / 2) + c &#8211; 5<br />
O (b) ((A ** 2) * (B / 2)) + c &#8211; 5<br />
O (c) (A ** 2) * (B / (2 + c)) &#8211; 5<br />
O (d) ((A ** (2 * B)) / 2) + c &#8211; 5<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 6<br />
10. A COBOL programmer wants to print out a number in his.her program. Which of the following<br />
variables is best suited for this purpose?<br />
+123.45<br />
we assume that ‘.’ is the decimal point<br />
O (a) PIC 9(5)<br />
O (b) PIC +9(3).99<br />
O (c) PIC +9(3)V9(2)<br />
O (d) PIC 9(3).V9(2)<br />
11. Take a look at the following variable declarations. What will be the content of RESULT at the<br />
end of the series of MOVE instructions?<br />
01 VAR-1 PIC X(5) VALUE (PL/I).<br />
01 VAR-2 PIC X(10).<br />
01 VAR-3 PIC X(2).<br />
01 RESULT PIC X(5).<br />
MOVE ‘COBOL’ TO RESULT<br />
MOVE VAR-1 TO VAR-2<br />
MOVE VAR-2 TO VAR-3<br />
MOVE VAR-3 TO RESULT<br />
O (a) PLbbb (bbb = 3 blancs)<br />
O (b) COBOL<br />
O (c) COBPL<br />
O (d) PLBOL<br />
12. Which of the following variable declarations are syntactically correct?<br />
(1) 01 VAR-1 PIC SX(4).<br />
(2) 01 VAR-2 PIC S9(4).<br />
(3) 01 VAR-1 PIC V99.<br />
(4) 01 VAR-1 PIC P99.<br />
(5) 01 VAR-1 PIC 9(4)S.<br />
(6) 01 VAR 1 PIC X(4).<br />
O (a) 2, 3, and 6<br />
O (b) 3, 4 and 6<br />
O (c) 1, 2 and 3<br />
O (d) 2, 3 and 4<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 7<br />
13. Which of the follwing PIC definitions can be used in the declaration of a record of a sequential<br />
file that will be used as INPUT (2 answers)<br />
[_] [a] PIC X(9)<br />
[_] [b] PIC S9(4) COMP<br />
[_] [c] PIC Z(4)<br />
[_] [d] PIC 9(4)V99<br />
[_] [e] PIC 9(4).99<br />
14. Which tests are allowed with the following variable? (2 answers)<br />
01 END-OF-FILE PIC X.<br />
88 EOF VALUE ‘N’.<br />
[_] [a] IF EOF THEN &#8230;<br />
[_] [b] IF EOF IS TRUE THEN &#8230;<br />
[_] [c] IF END-OF-FILE = ‘Y’ THEN &#8230;<br />
[_] [d] IF END-OF-FILE THEN &#8230;<br />
15. Assume one wants to print out the follwing number. How must the display variable be declared<br />
in the COBOL program.<br />
content 00232^45 negative (^ is the presumed decimal sign)<br />
display $bbb232.45- ( bbb = 3 blancs)<br />
O (a) PIC $Z(6).99-<br />
O (b) PIC $(7).99-<br />
O (c) PIC $Z(6)V99-<br />
O (d) PIC -$Z(6).99<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 8<br />
16. Which of the following COBOL EVALUATE statements in syntactically NOT correct?<br />
O (a)<br />
EVALUATE A<br />
WHEN 0 DISPLAY ‘A = 0‘<br />
WHEN 5 DISPLAY ‘A = 5‘<br />
WHEN OTHER DISPLAY ‘A IS NOT 0 NOR 5’<br />
END-EVALUATE<br />
O (b)<br />
EVALUATE TRUE<br />
WHEN A=0 DISPLAY ‘A = 0‘<br />
WHEN A=5 DISPLAY ‘A = 5‘<br />
WHEN OTHER DISPLAY ‘A IS NOT 0 OR 5’<br />
END-EVALUATE<br />
O (c)<br />
EVALUATE A<br />
WHEN A=0 DISPLAY ‘A = 0‘<br />
WHEN A=5 DISPLAY ‘A = 5‘<br />
WHEN OTHER DISPLAY ‘A IS NOT 0 NOR 5’<br />
END-EVALUATE<br />
17. Take a look at the following COBOL instruction. When will PAR-3 be executed?<br />
IF A=B THEN<br />
PAR-1<br />
ELSE<br />
PAR-2.<br />
PAR-3<br />
O (a) never<br />
O (b) if A is equal to B<br />
O (c) if A is different from B<br />
O (d) always<br />
18. For each file you want to read in in a COBOL program you have to provide a set of declarations<br />
and instructions. In which order must they be executed?<br />
(1) SELECT infile ASSIGN TO xx<br />
(2) READ infile<br />
(3) OPEN INPUT infile<br />
(4) CLOSE infile<br />
O (a) 3, 1, 2, 4<br />
O (b) 1, 3, 2, 4<br />
O (c) 1, 2, 3, 4<br />
O (d) 3, 2, 1, 4<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 9<br />
19. Which of the following statements concerning files are true ? (2 answers)<br />
[_] [a] the FD entry in the DATA DIVISION gives a description of the structure of a file.<br />
[_] [b] the first record is automatically read on opening a file.<br />
[_] [c] if a file is opened in I-O mode you can use this file for reading as well as for writing.<br />
[_] [d] you can not read indexed files from a COBOL program.<br />
[_] [e] in the SELECT clause you have to give a complete description of the exact location of<br />
the file.<br />
20. What is the content of RESULT after execution of the following COBOL instruction. The start<br />
value of RESULT is 0.<br />
PERFORM VARYING C FROM 1 BY 1 UNTIL C = 6<br />
COMPUTE RESULT = RESULT + 1<br />
END-PERFORM<br />
O (a) 4<br />
O (b) 5<br />
O (c) 6<br />
O (d) 7<br />
10/02/2006 Selftest : COBOL programming &#8211; part 1 10<br />
EVALUATION.<br />
Here are the correct answers to all questions:<br />
1. c<br />
2. a<br />
3. b<br />
4. b<br />
5. a c<br />
6. a c d<br />
7. d<br />
8. d<br />
9. a<br />
10. b<br />
11. a<br />
12. d<br />
13. a d<br />
14. a c<br />
15. a<br />
16. c<br />
17. d<br />
18. b<br />
19. a c<br />
20. b</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newcoin.info/cobol%e8%80%83%e8%af%95%e8%87%aa%e6%b5%8b%e9%a2%98%e5%ba%93.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>COBOL经典面试题库（中英文版）</title>
		<link>http://www.newcoin.info/cobol%e7%bb%8f%e5%85%b8%e9%9d%a2%e8%af%95%e9%a2%98%e5%ba%93%ef%bc%88%e4%b8%ad%e8%8b%b1%e6%96%87%e7%89%88%ef%bc%89.html</link>
		<comments>http://www.newcoin.info/cobol%e7%bb%8f%e5%85%b8%e9%9d%a2%e8%af%95%e9%a2%98%e5%ba%93%ef%bc%88%e4%b8%ad%e8%8b%b1%e6%96%87%e7%89%88%ef%bc%89.html#comments</comments>
		<pubDate>Mon, 16 Mar 2009 09:07:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[大型机｜Mainframe]]></category>
		<category><![CDATA[CICS]]></category>
		<category><![CDATA[cobol]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[JCL]]></category>
		<category><![CDATA[大机]]></category>
		<category><![CDATA[文档资料]]></category>
		<category><![CDATA[面试]]></category>
		<category><![CDATA[题库]]></category>

		<guid isPermaLink="false">http://newcoin.info/?p=27278</guid>
		<description><![CDATA[我们经常用来复习用的，大多数版本只有英文，这个好像还是基地的同事们一起翻译出来的 Q1) Name the divisions in a COBOL program ?. A1) IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION. Q：列举COBOL的DEVISION A：标识部，环境部，数据部，过程部 Q2) What are the different data types available in COBOL? A2) Alpha-numeric (X), alphabetic (A) and numeric (9). Q：COBOL有哪些可用的数据类型 A：字符型（这里指的是包含字母和数字），字母型，数字型 Q3) What does the INITIALIZE verb do? &#8211; GS A3) Alphabetic, Alphanumeric fields &#38; [...]]]></description>
			<content:encoded><![CDATA[<p>我们经常用来复习用的，大多数版本只有英文，这个好像还是基地的同事们一起翻译出来的</p>
<p>Q1)	Name the divisions in a COBOL program ?.<br />
A1)	IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.<br />
Q：列举COBOL的DEVISION<br />
A：标识部，环境部，数据部，过程部</p>
<p>Q2)	What are the different data types available in COBOL?<br />
A2)	Alpha-numeric (X), alphabetic (A) and numeric (9).<br />
Q：COBOL有哪些可用的数据类型<br />
A：字符型（这里指的是包含字母和数字），字母型，数字型<br />
<span id="more-27278"></span><br />
Q3)	What does the INITIALIZE verb do?  &#8211; GS<br />
A3)	Alphabetic, Alphanumeric fields &amp; alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER , OCCURS DEPENDING ON items left untouched.<br />
Q：INITIALIZE这个词做了些什么<br />
A：将字母，字符，数字区域都置成空格（置空），将数字区置0， FILLER和OCCURS DEPENDING ON项不处理</p>
<p>Q4)	What is 77 level used for ?<br />
A4)	Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.<br />
Q：77层有什么作用<br />
A：基本层数据项，不能用做细分别的层，也不能被细分<br />
（来源：http://www.newcoin.info）</p>
<p>Q5)	What is 88 level used for ?<br />
A5)	For condition names.<br />
Q：88层有什么作用<br />
A：条件逻辑层</p>
<p>Q6)	What is level 66 used for ?<br />
A6)	For RENAMES clause.<br />
Q：66层有什么作用<br />
A：重命名层</p>
<p>Q7)	What does the IS NUMERIC clause establish ?<br />
A7)	IS NUMERIC can be used on alphanumeric items, signed numeric &amp; packed decimal items and unsigned numeric &amp; 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 &#8211; .<br />
Q：IS NUMERIC这个子句怎么确定（也就是说确定句子的真值）<br />
A：IS NUMERIC用在字符项，带符号数字，浮点数，不带符号数。如果目标项只含0~9则返回TRUE。但是，如果待测项目是个带符号数，那么他就含有0-9还有+和-</p>
<p>Q8)	How do you define a table/array in COBOL?<br />
A8)	ARRAYS.<br />
05	ARRAY1	PIC X(9) OCCURS 10 TIMES.<br />
05	ARRAY2	PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX<br />
Q：COBOL中怎么建表/数组<br />
A：如上.</p>
<p>Q9)	Can the OCCURS clause be at the 01 level?<br />
A9)	No.<br />
Q：OCCURS 子句能用在第一层吗<br />
A：不能</p>
<p>（来源：<a href="http://www.newcoin.info">http://www.newcoin.info</a>）</p>
<p>Q10)	What is the difference between index and subscript? &#8211; GS<br />
A10)	Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the<br />
array. An index can only be modified using PERFORM, SEARCH &amp; SET. Need to have index for a table in order to<br />
use SEARCH, SEARCH ALL.<br />
Q：索引和下标有什么区别<br />
A：下标可以指定数组中任意中位置的元素（只要知道其下标），下标只能是数字型常量或者数字型变量（但是不能在指定的时候修改，如：A（K+1）这样是不行的，要修改的话要在指定的外部改，如：ADD 1 TO K，而索引的话是从表头/数组头开始检索（以BY N的指定检索规律往后滚）<br />
再者，索引只能通过PERFORM, SEARCH 和SET来修改，如果要在一个表中使用SEARCH, SEARCH ALL，那这个表就要有索引（因为SEARCH, SEARCH ALL的参数中指定索引，所以即使其有很多限制还是得用它）</p>
<p>Q11)	What is the difference between SEARCH and SEARCH ALL? &#8211; GS<br />
A11)	SEARCH &#8211; is a serial search.<br />
SEARCH ALL &#8211; is a binary search &amp; the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used &amp; data loaded in this order) before using SEARCH ALL.<br />
Q：SERACH和SERACH ALL有什么区别<br />
A：SEARCH是顺序查找<br />
SERACH ALL 是2叉查找（相信数据结构学过2叉树的都不会陌生），在使用SEARCH ALL前表必须有一个递增/递减的KEY，并且表已经按照其KEY值排序了，这样才能使用SEARCH ALL</p>
<p>Q12)	What should be the sorting order for SEARCH ALL? &#8211; GS<br />
A12)	It can be either ASCENDING or DESCENDING.  ASCENDING is default.  If you want the search to be done on an<br />
array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You<br />
must load the table in the specified order).<br />
Q：为了使用SEARCH ALL，存贮顺序是怎么样的<br />
A：他必须是递增或者是递减的，默认地政。如果你想在一个递减顺序存贮的表/数组使用搜索的话，那么当定义表/数组的时候你应该加一个DESCENDING KEY子句（这之前表要已经按指定的顺序排序了）</p>
<p>Q13)	What is binary search?<br />
A13)	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.<br />
Q：什么是2叉查找<br />
A：将你要找的目标项与数组的正中项比较，找到就结束搜索，没找到则继续如此循环（比较下一个中值），取哪一半取决于目标值大于中值还是小于中值<br />
PS：联想2叉树的查找规律就很好理解，因为所谓的“表“本身也就是数组</p>
<p>Q14)	My program has an array defined to have 10 items.  Due to a bug, I find that even if the program access the<br />
11th item in this array, the program does not abend.  What is wrong with it?<br />
A14)	Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.<br />
Q：我的程序有个数组定义了10项。因为有个BUG，我发现即使访问第11项，程序也不异常终止。那是出了什么问题<br />
A：必须使用编译器的一个选项SSRANGE，如果你想检查数组的超界问题。默认是NOSSRANGE</p>
<p>Q15)	How do you sort in a COBOL program?  Give sort file definition, sort statement syntax and meaning. &#8211; GS<br />
A15)	 Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;. USING file-2 GIVING file-3.</p>
<p>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.</p>
<p>file-1 is the sort (work) file 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<br />
clause in FILE CONTROL.<br />
file-3 is the out file from the SORT and must be described using an FD entry in FILE SECTION and SELECT<br />
clause in FILE CONTROL.<br />
file-1, file-2 &amp; file-3 should not be opened explicitly.</p>
<p>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.<br />
Q：怎么在一个COBOL程序中排序？给出排序文件的定义，排序语法和意思<br />
A：语法就是SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;. USING file-2 GIVING file-3.<br />
USING后程序的输入接口，这个地方可以替换成一个输出过程，也就是说写一个过程往USING这个接口中导数据（要在这个过程中READ，AT END，……），这个过程在将数据释放到执行排序的文件中之前执行，GIVING后是输出借口，用法类似。<br />
此例中输入文件是file-2输出文件是file3(这样个文件必须在文件区中用FD和在文件控制中用到SELECT)真正执行排序的file-1，这里需要注意的是file-1中的文件区不能用FD，应该用SD，file-2和3还是一样（用FD），具体可以看一下书上的例子</p>
<p>Q16)	How do you define a sort file in JCL that runs the COBOL program?<br />
A16)	Use the SORTWK01, SORTWK02,&#8230;.. dd names in the step. Number of sort datasets depends on the volume of data<br />
being sorted, but a minimum of 3 is required.<br />
Q：怎么在JCL中定义一个排序文件来跑这个COBOL程序<br />
A：用SORTWK01, SORTWK02,&#8230;..作为DATA SET NAME。用多少取决于你要排序的数量，但是至少3个。</p>
<p>Q17)	What is the difference between performing a SECTION and a PARAGRAPH? &#8211; GS<br />
A17)	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.<br />
Q：执行一个区和一个段有什么区别<br />
A：简单来说的话就是区的概念比段大，执行一个区就要执行其内部所有段，执行段的话只执行该段。</p>
<p>（来源：<a href="http://www.newcoin.info">http://www.newcoin.info</a>）</p>
<p>Q18)	What is the use of EVALUATE statement? &#8211; GS<br />
A18)	Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and<br />
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<br />
made.<br />
Q：EVALUATE语句有什么作用<br />
A：EVALUATE就象个CASE语句（多重开关语句，学过C的总知道吧），不同点在于EVALUATE不需要BREAK，一旦匹配就跳出EVALUATE语句了</p>
<p>Q19)	What are the different forms of EVALUATE statement?<br />
A19)<br />
EVALUATE                                          	EVALUATE SQLCODE ALSO FILE-STATUS<br />
WHEN A=B AND C=D                      		WHEN 100 ALSO &#8217;00&#8242;<br />
imperative stmt                                        		imperative stmt<br />
WHEN (D+X)/Y = 4                            		WHEN -305 ALSO &#8217;32&#8242;<br />
imperative stmt                                        		imperative stmt<br />
WHEN OTHER                                    		WHEN OTHER<br />
imperative stmt                                        		imperative stmt<br />
END-EVALUATE                              	END-EVALUATE</p>
<p>EVALUATE SQLCODE ALSO A=B    	EVALUATE SQLCODE ALSO TRUE<br />
WHEN 100 ALSO TRUE                       		WHEN 100 ALSO A=B<br />
imperative stmt                                 		imperative stmt<br />
WHEN -305 ALSO FALSE             		WHEN -305 ALSO (A/C=4)<br />
imperative stmt                                    	imperative stmt<br />
END-EVALUATE                                    	END-EVALUATE</p>
<p>Q20)	How do you come out of an EVALUATE statement? &#8211; GS<br />
A20)	After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the<br />
EVALUATE statement.  There is no need of any extra code.<br />
Q：怎么跳出一条EVALUATE语句<br />
A：象18题目说的那样，一旦匹配了某一个“WHEN“语句就自动跳出了，不需要什么额外的代码来跳出</p>
<p>Q21)	In an EVALUATE statement, can I give a complex condition on a when clause?<br />
A21)	Yes.<br />
Q：在一个EVALUATE语句的某个WHEN分支中能否再插入复杂的情况（也就是嵌套）<br />
A：当然可以，当多个参数作为控制变量的时候1个WHEN内部可以嵌套更多的情况</p>
<p>Q22)	What is a scope terminator?  Give examples.<br />
A22)	Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.<br />
Q：什么是结束终止符<br />
A：结束终止符是搭配一些范围指令的，也就是标识一些范围指令的结束。如：EVALUATE, END-EVALUATE; IF, END-IF  如果没有该结束符，该条语句将终止不了</p>
<p>Q23)	How do you do in-line PERFORM? &#8211; GS<br />
A23)	PERFORM &#8230;  &#8230;</p>
<p>END-PERFORM<br />
Q：怎么使用内嵌的PERFORM<br />
A：PERFORM &#8230;  &#8230;</p>
<p>END-PERFORM<br />
所谓内嵌也就是PERFORM被嵌在某些比如循环语句中担当执行主体，同时通过UNTIL来指定结束判定</p>
<p>Q24)	When would you use in-line perform?<br />
A24)	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<br />
(used from various other places in the program), it would be better to put the code in a separate Para and use<br />
PERFORM Para name rather than in-line perform.<br />
Q：什么时候使用内嵌式PERFORM<br />
A：当该段PERFORM的内容不被其他段用到，只在某些局部代码中（当然PERFORM的主体所用到的参数也都是局部的，例如循环）使用，如果PERFORM主体的代码是一般的（用到了别的程序段的变量），还是使用PERFORM Para name这样的形式比较好（也就是相对与内于PERFORM的外部PERFORM）。</p>
<p>Q25)	What is the difference between CONTINUE &amp; NEXT SENTENCE ?<br />
A25)	They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would<br />
take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if<br />
sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 &gt; 0<br />
then next sentence end if display &#8216;line 1&#8242; display &#8216;line 2&#8242;. display &#8216;line 3&#8242;. *** Note- there is a dot (.) only at the end of<br />
the last 2 statements, see the effect by replacing Next Sentence with Continue ***<br />
Q：CONTINUE 和 NEXT SENTENCE有什么不同<br />
A：两者比较相似，都是将程序控制权交给下一句，但是用NEXT SENTENCE的时候，只有当碰到句结束符（就是句末的‘.’）才会将执行下句<br />
这道题我用了2个例子测试了一下：<br />
1：IF TEST-NUMERIC &gt; 0<br />
THEN NEXT SENTENCE<br />
END-IF<br />
DISPLAY &#8216;LINE1&#8242; DISPLAY &#8216;LINE2&#8242;. DISPLAY &#8216;LINE3&#8242;.（请注意代码中的‘.’号）<br />
结果输出：LINE3<br />
2：IF TEST-NUMERIC &gt; 0<br />
THEN CONTINUE<br />
END-IF<br />
DISPLAY &#8216;LINE1&#8242; DISPLAY &#8216;LINE2&#8242;. DISPLAY &#8216;LINE3&#8242;.<br />
结果输出：LINE1<br />
LINE2<br />
LINE3<br />
相信已经区别已经比较明显了，NEXT SENTENCE是靠句末的结束符（也就是‘.‘）来判断下一句的，而CONTINUE是通过句头的保留字（这例中是DISPLAY）来判断下一句的<br />
Q26)	What does EXIT do ?<br />
A26)	Does nothing ! If used, must be the only sentence within a paragraph.<br />
Q：EXIT语句有什么作用<br />
A：什么都不做，如果用到的话，肯定是作为一段的唯一的一句话，注意：这里不是子程序中用的EXIT PROGRAME</p>
<p>（来源：<a href="http://www.newcoin.info">http://www.newcoin.info</a>）</p>
<p>Q27)	Can I redefine an X(100) field with a field of X(200)?<br />
A27)	Yes. Redefines just causes both fields to start at the same location. For example:</p>
<p>01 WS-TOP PIC X(1)<br />
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).<br />
If you MOVE &#8217;12&#8242; to WS-TOP-RED,<br />
DISPLAY WS-TOP will show 1 while<br />
DISPLAY WS-TOP-RED will show 12.<br />
Q：能不能把X（100）的区域重定义成X（200）<br />
A：可以，重定义只是相当于把两个区域的首地址放在一起，从上面这个例子也很好理解</p>
<p>A28)	Can I redefine an X(200) field with a field of X(100) ?<br />
Q31)1	Yes.<br />
Q：能不能把X（200）的区域重定义成X（100）<br />
A：可以，原因同上</p>
<p>Q31)2	What do you do to resolve SOC-7 error? &#8211; GS<br />
Q31)	Basically you need to correcting the offending data. Many times the reason for SOC7 is an un-initialized numeric item.<br />
Examine that possibility first. Many installations provide you a dump for run time abend’s ( it can be  generated also<br />
by calling some subroutines or OS services thru  assembly language).  These dumps provide the offset of the last<br />
instruction at which the abend occurred.  Examine the compilation output XREF listing to get the verb and the line<br />
number of the source  code at this offset.  Then you can look at the source code to find the  bug.  To get capture the<br />
runtime dumps,  you will have to define some  datasets (SYSABOUT etc ) in the JCL. If none of these are helpful,  use<br />
judgement and DISPLAY to localize  the source of error. Some installation might have batch program debugging<br />
tools.  Use them.<br />
Q：怎么解决SOC-7错误<br />
A：基本上你要看一下一些比较奇怪的数据，很多导致SOC7的原因都是因为数据项的初始化。<br />
首先检查所有的可能性。某些功能可能提供一个空间用来存贮那些运行时间ABEND，并且提供最近一次运行时间ABEND的偏移量的说明（也就是位于队列中的位置），检查编译器的输出XREF队列以获得一些关键字。然后你就能看下源代码找出BUG。为了捕获一些运行时间的信息，你需要在JCL中建一个DATASET（象SYSABOUT这样的），如果这些都没用，那么再审查一下ERROR出现的位置判断一下原因。有些软件安装了会提供批处理程序调试工具，那么可以就可以用这些工具了。<br />
PS：以上大意就是说SOC-7这个错误多半是因为数据项初始化造成的，然后你应该到运行后编译器的返回信息中去找这些ERROR出现的地方（我们常用的话应该就是走查LOG），查的时候多注意下数据项的初始化问题。</p>
<p>Q32)	How is sign stored in Packed Decimal fields and Zoned Decimal fields?<br />
Q32)	Packed Decimal fields:	Sign is stored as a hex value in the last nibble (4 bits ) of the storage.<br />
Zoned Decimal fields:	As a default, sign is over punched with the numeric value stored in the last bite.<br />
Q：在内部十进制区域和显示十进制区域符号是怎么存贮的<br />
A：内部十进制是一个数字占4位（半字节），内存中用16进制来存，最后在追加4位作为符号，如-4=01001101（末尾的1101表示负，1100表示正），而我们用于显示的十进制，符号并不占空间，只是在最后一位上标识一下</p>
<p>Q33)	How is sign stored in a comp-3 field? &#8211; GS<br />
Q33)	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<br />
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;<br />
Q：COMP-3区怎么存储符号<br />
A：COMP-3采用的是内部十进制的存储方式，所谓内部十进制就是压缩式的外部十进制存储方式，上题讲过外部十进制每个数值都用1个字节存储，但前4位是存符号的，这样比较浪费存储空间，所以内部十进制的存储方式就用半个字节（4位）存储一个数字，在最后增加4位作为符号（1100（C）为正，1101（D）为负）</p>
<p>Q34)	How is sign stored in a COMP field ? &#8211; GS<br />
Q34)	In the most significant bit.  Bit is ON if -ve, OFF if +ve.<br />
Q：COMP区怎么存储符号<br />
A：COMP是采用定点二进制的方式存储数据，也就是将一个十进制的数值转化成二进制再进行存储，因为机器存储的形式也是二进制，所以定点二进制的读取是最快速的，因为COMP型的数据是用做计算（也就是说不用再转化成十进制打印），使用定点二进制将会非常高效。这样的存储方式符号是保存在最高有效果位上，如：10=（00001010）₂，</p>
<p>-10=（00011010）₂</p>
<p>（来源：<a href="http://www.newcoin.info">http://www.newcoin.info</a>）</p>
<p>Q35)	What is the difference between COMP &amp; COMP-3  ?<br />
Q35)	COMP is a binary storage format while COMP-3 is packed decimal format.<br />
Q：COMP和COMP-3什么区别<br />
A：这之前讲过了，COMP采用定点二进制存储，COMP-3采用内部十进制存储</p>
<p>Q36)	What is COMP-1? COMP-2?<br />
Q36)	COMP-1  &#8211; Single precision floating point. Uses 4 bytes.<br />
COMP-2 &#8211; Double precision floating point. Uses 8 bytes.<br />
Q：COMP-1是什么？什么是COMP-2<br />
A：其实之所以定义计算型数据（COMP~COMP-3）以区别DISPLAY（能计算，但是要用于打印）是为了考虑效率，因为大家知道文件导入（也就是USER使用的数据）一般是十进制的，而机器存储都是二进制，那么当定义的数据光用来计算不用打印，处于效率考虑会把它定义成COMP型，当然就会衍生出几类COMP以适应不用的数据类型的存储。很明显，这里COMP-1就是采用内部短浮点（4个字节表示一个数，8位指数部分，24位表示数字部分），COMP-2用内部长浮点型（8个字节表示一个书，16位指数部分，48位表示数字部分）以适应浮点数据的存储，长浮点精确度更高.</p>
<p>Q37)	How do you define a variable of COMP-1?  COMP-2?<br />
Q37)	No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.<br />
Q:怎么定义一个COMP-1型？COMP-2型<br />
A：不要用PICTURE描述，因为是确定分配多少内存的，直接用USAGE，如01 WS-VAR USAGE COMP-1</p>
<p>Q38)	How many bytes does a S9(7) COMP-3 field occupy ?<br />
Q38)	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<br />
example.<br />
Q：一个S9（7）的COMP-3型占用多少字节？<br />
A：占用4字节。COMP-3用内部十进制存储，S9（7）中的S是要占空间的，符号占4位，7个数字，每个4位（半个字节），所以是（4+7*4）/8=4字节（字节和位的比例不要搞错了哦）</p>
<p>Q39)	How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?<br />
Q39)	Will occupy 8 bytes (one extra byte for sign).<br />
Q：一个S9(7) SIGN TRAILING SEPARATE区域占多少字节<br />
A：这里是每个符号单独分配空间（也就是没个数值用1个字节表示，就象最常用的DISPLAY型的分配方式），算上S的空间，所以是7+1=8字节。一般情况省略的SIGN子句都是隐含SIGN IS TRAILING的</p>
<p>Q40)	How many bytes will a S9(8) COMP field occupy ?<br />
Q40)	4 bytes.<br />
Q： 一个S9(8) COMP 区域占多少字节<br />
A：如果之前关于COMP的解释听懂了的话，那很显然就是4字节了（定点二进制用2字节存储1~4，4字节存储5~9，……类推，你可以自己推下），如果这块还不懂的可以问我或者查下书</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newcoin.info/cobol%e7%bb%8f%e5%85%b8%e9%9d%a2%e8%af%95%e9%a2%98%e5%ba%93%ef%bc%88%e4%b8%ad%e8%8b%b1%e6%96%87%e7%89%88%ef%bc%89.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
