-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathReadMe_NewUsers.htm
158 lines (140 loc) · 29.1 KB
/
ReadMe_NewUsers.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<h1><a id="newusers">Notes for New Users</a></h2>
<p>The first thing new users need to decide is<ul>
<li>Are you going to use the <i>Java</i> interface ???, then see <a href="#javaInterface">Java Interface</a></li>
<li>Are you going to use the existing <a href="lib/Overview.html#Csv2Cbl">Cobol2Csv</a> / <a href="lib/CobolData2Xml/Cobol2Xml_ReadMe.htm">Cobol2Xml</a> interfaces. These programs will
convert Cobol-Data-Files to/from Csv/Xml files.</li>
<li>Are you going to write <i>your own generic</i> interface ???. If so look at the <b>CobolSchemaReader</b> class
and see how it is used in Cobol2Xml. Also If copying files, look at <b>Copy</b> class.</li>
</ul>
<h2><a id="javaInterface">Getting started with JRecord Java interface</a></h3>
<p>The starting point for the most common JRecord operations is the <b><font color="blue">JRecordInterface1</font> class</b>.
For Cobol operataions you start with <b><font color="blue">JRecordInterface1</font>.<font color="green">COBOL</font></b>.
<p>A program to read a <i>Cobol-Data</i> file using a cobol Copybook looks like:</p>
<pre><font color="#000000"><span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 2 </font></span> ICobolIOBuilder ioBldr
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 3 </font></span> <font color="#000000"><strong>=</strong></font> JRecordInterface1.COBOL
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 4 </font></span> .<font color="#9966ff">newIOBuilder</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">CobolCopybook</font><font color="#ff00cc">.</font><font color="#ff00cc">cbl</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066"> 5 </font></span> .<font color="#9966ff">setSplitCopybook</font><font color="#000000"><strong>(</strong></font>CopybookLoader.SPLIT_01_LEVEL<font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 6 </font></span> .<font color="#9966ff">setDialect</font><font color="#000000"><strong>(</strong></font>ICopybookDialects.FMT_FUJITSU<font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 7 </font></span> AbstractLineReader reader <font color="#000000"><strong>=</strong></font> ioBldr.<font color="#9966ff">newReader</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">input</font><font color="#ff00cc"> </font><font color="#ff00cc">File</font><font color="#ff00cc"> </font><font color="#ff00cc">Name</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 8 </font></span> AbstractLine l;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 9 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066"> 10 </font></span> <font color="#006699"><strong>while</strong></font> <font color="#000000"><strong>(</strong></font><font color="#000000"><strong>(</strong></font>l <font color="#000000"><strong>=</strong></font> reader.<font color="#9966ff">read</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>!</strong></font><font color="#000000"><strong>=</strong></font> <font color="#cc00cc">null</font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>{</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 11 </font></span> ...
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 12 </font></span> <font color="#000000"><strong>}</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 13 </font></span> reader.<font color="#9966ff">close</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>;
</font></pre>
<p>See the <a href="Docs/JRecordIntro.htm#HDRIOBLDR">JRecord Manual</a> for a description of IOBuilders.
There are examples in the <a href="Source\JRecord_IO_Builder_Examples">Source\JRecord_IO_Builder_Examples</a> project.
<p>If you have the <b>JavaDoc</b> setup correctly in your IDE, there are descriptions / list of options
available for the various methods:</p>
<img src="Docs/Diagram/JR_IOBuilder01.png">
<h2><a id="CodeGen">Code Generation</a></h3>
<p>To help you get started with JRecord, there are 2 Code Generators available:<ul>
<li>In the Cobol-Import section of the <a href="https://sourceforge.net/projects/record-editor/">RecordEditor</a>
you can specify a Cobol Copybook and a Sample data file. The RecordEditor should be able to figure out
the correct file options and it can create a IOBuilder + Field-Name class for the Cobol-Copybook/File. This
should be useful for new user trying to figure out which options to use. There is more on this in the.
See <a href="Docs/JRecordIntro.htm#HDRCBLIMPORT">RecordEditor in JRecord Guide</a> for details</li>
<li>CodeGen is now supplied with JRecord.
<li>The <a href="Docs/JRecordIntro.htm#HDRCODEGEN">JRecord CodeGen</a> sub-project will generate a skelton Java~JRecord Read/write programs from a Cobol Copybook.</li>
</ul>
<h3>Recordeditor: Generating Java JRecord from the Cobol Copybook</h3>
<p>The best way to get started with JRecord is to use the <a href="Docs/RecordEditorGenerate.htm">JRecord-Code Generator</a> in
the <a href="https://sourceforge.net/projects/record-editor/">RecordEditor</a> package. In the <a href="https://sourceforge.net/projects/record-editor/">RecordEditor</a>
Select the <b>Generate >>>> Java~JRecord code for cobol</b>:
<p><img SRC="Docs/Diagram/CobolGen01a.png"/></p>
<p>See the <a href="Docs/RecordEditorGenerate.htm">JRecord-Code Generator Documentation</a> for more details on
the <a href="https://sourceforge.net/projects/record-editor/">RecordEditor</a> Code Generator.
<h3>JRecord CodeGen Utility</h3>
<p>The <a href="https://sourceforge.net/projects/jrecord/files/jrecord_CodeGen/">CodeGen</a> utility will generate sample read/write programs for a Cobol Copybook.
The <b>CodeGen</b> utility can be downloaded from</p>
<p><a href="https://sourceforge.net/projects/jrecord/files/jrecord_CodeGen/">https://sourceforge.net/projects/jrecord/files/jrecord_CodeGen/</a></p>
<p>The following <b>CodeGen</b> examples all refer to this <b>Cobol Copybook</b>:
</p><p>
</p><pre><font color="#000000"><span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 9 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">03</font> DTAR020-KCODE-STORE-KEY.
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">10 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">05</font> DTAR020-KEYCODE-NO <font color="#006699"><strong>PIC</strong></font> X(<font color="#ff0000">08</font>).
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">11 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">05</font> DTAR020-STORE-NO <font color="#006699"><strong>PIC</strong></font> S9(<font color="#ff0000">03</font>) <font color="#006699"><strong>COMP-3</strong></font>.
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">12 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">03</font> DTAR020-DATE <font color="#006699"><strong>PIC</strong></font> S9(<font color="#ff0000">07</font>) <font color="#006699"><strong>COMP-3</strong></font>.
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">13 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">03</font> DTAR020-DEPT-NO <font color="#006699"><strong>PIC</strong></font> S9(<font color="#ff0000">03</font>) <font color="#006699"><strong>COMP-3</strong></font>.
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">14 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">03</font> DTAR020-QTY-SOLD <font color="#006699"><strong>PIC</strong></font> S9(<font color="#ff0000">9</font>) <font color="#006699"><strong>COMP-3</strong></font>.
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">15 </font></span><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font><font color="#cc6600"> </font> <font color="#ff0000">03</font> DTAR020-SALE-PRICE <font color="#006699"><strong>PIC</strong></font> S9(<font color="#ff0000">9</font>)V99 <font color="#006699"><strong>COMP-3</strong></font>.
</font></pre>
<p>
</p>
<b>Java Interface</b>
<p>There is a builder style interface to CodeGen. In the following example, the <b>analyseDataFileSetAttributes</b> codegen to try and determine file
attributes from the sample data file.
<pre><font color="#000000"><span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066"> 5 </font></span> CodeGenInterface.TEMPLATES.<font color="#9966ff">newTempateBuilder</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">DTAR020</font><font color="#ff00cc">.</font><font color="#ff00cc">cbl</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 6 </font></span> .<font color="#9966ff">setDataFile</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">DTAR020</font><font color="#ff00cc">.</font><font color="#ff00cc">bin</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 7 </font></span> .<font color="#9966ff">analyseDataFileSetAttributes</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 8 </font></span> .<font color="#9966ff">setTemplate</font><font color="#000000"><strong>(</strong></font>StandardTemplates.STANDARD<font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000"> 9 </font></span> .<font color="#9966ff">setPackageName</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">dtar020</font><font color="#ff00cc">.</font><font color="#ff00cc">standard</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">10 </font></span> .<font color="#9966ff">setOutputDirectory</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">G</font><font color="#ff00cc">:</font><font color="#6600cc">\\</font><font color="#ff00cc">Temp</font><font color="#6600cc">\\</font><font color="#ff00cc">Gen</font><font color="#6600cc">\\</font><font color="#ff00cc">TestCodeGen</font><font color="#6600cc">\\</font><font color="#ff00cc">dtar020</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">11 </font></span> .<font color="#9966ff">generateJava</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">12 </font></span> .<font color="#9966ff">writeTemplateBuilderCode</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">build</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>;
</font></pre>
<p>There are examples of generating Java-JRecord code using the <b>standard</b> Template in the <a href="CodeGenExample/standard">CodeGenExample/standard</a> directory.</p>
<p>Basically to generate Java code for a Mainframe EBCDIC Fixed-Record-Length file:</p>
<b>bat Interface</b>
<p>To call <b>CodeGen</b> in a bat file:
</p><pre><p>
java -jar ../../lib/JRecordCodeGen.jar ^
<font color="blue"> -Template standard</font> ^
-package example.ioBuilder.dtar020 ^
-Schema DTAR020.cbl ^
-FileOrganisation FixedWidth ^
-font cp037 ^
-DropCopybookName true ^
-outputDirectory DTAR020
</p></pre>
<p>
</p><p>This will generate a <font color="blue">Cobol-Field-name</font> class, skelton <font color="blue">Read</font> class and a skelton <font color="blue">write</font> class.
The generated <b>FieldName</b> class is
</p><p>
</p><pre><font color="#000000"><span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">32 </font></span><font color="#009966"><strong>public</strong></font> <font color="#0099ff"><strong>class</strong></font> FieldNamesDtar020 <font color="#000000"><strong>{</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">33 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">34 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>static</strong></font> <font color="#009966"><strong>final</strong></font> RecordDtar020 RECORD_DTAR020 <font color="#000000"><strong>=</strong></font> <font color="#006699"><strong>new</strong></font> <font color="#9966ff">RecordDtar020</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">35 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">36 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>static</strong></font> <font color="#0099ff"><strong>class</strong></font> RecordDtar020 <font color="#000000"><strong>{</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">37 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String keycodeNo <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">KEYCODE</font><font color="#ff00cc">-</font><font color="#ff00cc">NO</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">38 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String storeNo <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">STORE</font><font color="#ff00cc">-</font><font color="#ff00cc">NO</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">39 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String date <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">DATE</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">40 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String deptNo <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">DEPT</font><font color="#ff00cc">-</font><font color="#ff00cc">NO</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">41 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String qtySold <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">QTY</font><font color="#ff00cc">-</font><font color="#ff00cc">SOLD</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">42 </font></span> <font color="#009966"><strong>public</strong></font> <font color="#009966"><strong>final</strong></font> String salePrice <font color="#000000"><strong>=</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc">SALE</font><font color="#ff00cc">-</font><font color="#ff00cc">PRICE</font><font color="#ff00cc">"</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">43 </font></span> <font color="#000000"><strong>}</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">44 </font></span><font color="#000000"><strong>}</strong></font>
</font></pre>
<p>
</p><p>The generated code to <b>read</b> the file is
</p><p>
</p><pre><font color="#000000"><span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">60 </font></span> AbstractLine line;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">61 </font></span> <font color="#0099ff"><strong>int</strong></font> lineNum <font color="#000000"><strong>=</strong></font> <font color="#ff0000">0</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">62 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">63 </font></span> <font color="#006699"><strong>try</strong></font> <font color="#000000"><strong>{</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">64 </font></span> ICobolIOBuilder iob <font color="#000000"><strong>=</strong></font> JRecordInterface1.COBOL
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">65 </font></span> .<font color="#9966ff">newIOBuilder</font><font color="#000000"><strong>(</strong></font>copybookName<font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">66 </font></span> .<font color="#9966ff">setFont</font><font color="#000000"><strong>(</strong></font><font color="#ff00cc">"</font><font color="#ff00cc">CP037</font><font color="#ff00cc">"</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">67 </font></span> .<font color="#9966ff">setFileOrganization</font><font color="#000000"><strong>(</strong></font>Constants.IO_FIXED_LENGTH<font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">68 </font></span> .<font color="#9966ff">setSplitCopybook</font><font color="#000000"><strong>(</strong></font>CopybookLoader.SPLIT_NONE<font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">69 </font></span> .<font color="#9966ff">setDropCopybookNameFromFields</font><font color="#000000"><strong>(</strong></font><font color="#cc00cc">true</font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">70 </font></span> ;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">71 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">72 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">73 </font></span> FieldNamesDtar020.RecordDtar020 rDtar020 <font color="#000000"><strong>=</strong></font> FieldNamesDtar020.RECORD_DTAR020;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">74 </font></span> AbstractLineReader reader <font color="#000000"><strong>=</strong></font> iob.<font color="#9966ff">newReader</font><font color="#000000"><strong>(</strong></font>salesFile<font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">75 </font></span> <font color="#006699"><strong>while</strong></font> <font color="#000000"><strong>(</strong></font><font color="#000000"><strong>(</strong></font>line <font color="#000000"><strong>=</strong></font> reader.<font color="#9966ff">read</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>!</strong></font><font color="#000000"><strong>=</strong></font> <font color="#cc00cc">null</font><font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>{</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">76 </font></span> lineNum <font color="#000000"><strong>+</strong></font><font color="#000000"><strong>=</strong></font> <font color="#ff0000">1</font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">77 </font></span> System.out.<font color="#9966ff">println</font><font color="#000000"><strong>(</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">78 </font></span> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.keycodeNo<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">79 </font></span> <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc"> </font><font color="#ff00cc">"</font> <font color="#000000"><strong>+</strong></font> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.storeNo<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">80 </font></span> <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc"> </font><font color="#ff00cc">"</font> <font color="#000000"><strong>+</strong></font> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.date<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">81 </font></span> <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc"> </font><font color="#ff00cc">"</font> <font color="#000000"><strong>+</strong></font> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.deptNo<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">82 </font></span> <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc"> </font><font color="#ff00cc">"</font> <font color="#000000"><strong>+</strong></font> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.qtySold<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">83 </font></span> <font color="#000000"><strong>+</strong></font> <font color="#ff00cc">"</font><font color="#ff00cc"> </font><font color="#ff00cc">"</font> <font color="#000000"><strong>+</strong></font> line.<font color="#9966ff">getFieldValue</font><font color="#000000"><strong>(</strong></font>rDtar020.salePrice<font color="#000000"><strong>)</strong></font>.<font color="#9966ff">asString</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">84 </font></span> <font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#990066">85 </font></span> <font color="#000000"><strong>}</strong></font>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">86 </font></span>
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">87 </font></span> reader.<font color="#9966ff">close</font><font color="#000000"><strong>(</strong></font><font color="#000000"><strong>)</strong></font>;
<span style="background:#dbdbdb; border-right:solid 2px black; margin-right:5px; "><font color="#000000">88 </font></span> <font color="#000000"><strong>}</strong></font> <font color="#006699"><strong>catch</strong></font> <font color="#000000"><strong>(</strong></font>Exception e<font color="#000000"><strong>)</strong></font> <font color="#000000"><strong>{</strong>
</font></font></pre>