-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patherrorlist.txt
7941 lines (7941 loc) · 954 KB
/
errorlist.txt
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 1
Command . . . . . . . . . . . . : CRTBNDRPG
Issued by . . . . . . . . . . : NLI
Program . . . . . . . . . . . . : CVTRPGFRER
Library . . . . . . . . . . . : CVTRPGFREE
Text 'description' . . . . . . . : Convert to RPG free
Source stream file . . . . . . : src/cvtrpgfreR.rpgle
CCSID . . . . . . . . . . . . : 500
Text 'description' . . . . . . . :
Last Change . . . . . . . . . . : 25-06-20 14:41:39
Generation severity level . . . : 10
Default activation group . . . . : *YES
Compiler options . . . . . . . . : *XREF *GEN *NOSECLVL *SHOWCPY
*EXPDDS *EXT *NOSHOWSKP *NOSRCSTMT
*DEBUGIO *NOUNREF *NOEVENTF
Debugging views . . . . . . . . : *LIST
Debug encryption key . . . . . . : *NONE
Output . . . . . . . . . . . . . : *PRINT
Optimization level . . . . . . . : *NONE
Source listing indentation . . . : *NONE
Type conversion options . . . . : *NONE
Sort sequence . . . . . . . . . : *HEX
Language identifier . . . . . . : *JOBRUN
Replace program . . . . . . . . : *YES
User profile . . . . . . . . . . : *USER
Authority . . . . . . . . . . . : *LIBCRTAUT
Truncate numeric . . . . . . . . : *YES
Fix numeric . . . . . . . . . . : *NONE
Target release . . . . . . . . . : *CURRENT
Allow null values . . . . . . . : *NO
Define condition names . . . . . : *NONE
Enable performance collection . : *PEP
Profiling data . . . . . . . . . : *NOCOL
Licensed Internal Code options . :
Generate program interface . . . : *NO
Include directory . . . . . . . : ./..
Preprocessor options . . . . . . : *NONE
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 2
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
S o u r c e L i s t i n g
1 *FREE 000001
2 Ctl-Opt Debug 000002
3 DftActGrp( *No ) ActGrp( *Caller ) 000003
4 Option( *ShowCpy: *SrcStmt: *NoDebugIO ); 000004
000005 000005
000006 //------------------------------------------------------------------------------------------- 000006
000007 // Program Name. . . . . : CVTRPGFREE 000007
000008 // Program Description . : Convert RPGILE Source Member to Free-form 000008
000009 // Date Created. . . . . : 30/04/2015 000009
000010 // Programmer. . . . . . : Ewarwoowar 000010
000011 // 000011
000012 // By Date Fix 000012
000013 // Niels Liisberg 10.02.2020 Support for source more that 999 lines of code 000013
000014 //------------------------------------------------------------------------------------------- 000014
000015 // SYNOPSIS : 000015
000016 // - Reads through an RPGILE source member and reformats the contents. 000016
000017 //------------------------------------------------------------------------------------------- 000017
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 3
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000019 //------------------------------------------------------------------------------------------- 000019
000020 // F I L E S 000020
000021 //------------------------------------------------------------------------------------------- 000021
*--------------------------------------------------------------------*
* Compiler Options in Effect: *
*--------------------------------------------------------------------*
* Text 'description' . . . . . . . : *
* Convert to RPG free *
* Generation severity level . . . : 10 *
* Default activation group . . . . : *NO *
* Compiler options . . . . . . . . : *XREF *GEN *
* *NOSECLVL *SHOWCPY *
* *EXPDDS *EXT *
* *NOSHOWSKP *SRCSTMT *
* *NODEBUGIO *NOUNREF *
* *NOEVENTF *
* Optimization level . . . . . . . : *NONE *
* Source listing indentation . . . : *NONE *
* Type conversion options . . . . : *NONE *
* Sort sequence . . . . . . . . . : *HEX *
* Language identifier . . . . . . : *JOBRUN *
* User profile . . . . . . . . . . : *USER *
* Authority . . . . . . . . . . . : *LIBCRTAUT *
* Truncate numeric . . . . . . . . : *YES *
* Fix numeric . . . . . . . . . . : *NONE *
* Allow null values . . . . . . . : *NO *
* Storage model . . . . . . . . . : *SNGLVL *
* Binding directory from Command . : *NONE *
* Binding directory from Source . : *NONE *
* Activation group . . . . . . . . : *CALLER *
* Enable performance collection . : *PEP *
* Profiling data . . . . . . . . . : *NOCOL *
* Generate program interface . . . : *NO *
*--------------------------------------------------------------------*
000022 Dcl-F QRPGLESRC EXTMBR(QpFromMbr) 000022
000023 EXTFILE('QTEMP/QRPGLESRC') 000023
000024 RENAME(QRPGLESRC:SRCREC) 000024
000025 USROPN; 000025
*--------------------------------------------------------------------------------------------*
* RPG name External name *
* File name. . . . . . . . . : QRPGLESRC CVTRPGFREE/QRPGLESRC *
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 4
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
* Record format(s) . . . . . : SRCREC QRPGLESRC *
*--------------------------------------------------------------------------------------------*
000026 000026
000027 Dcl-F QRPGLESRC2 Usage(*OUTPUT) EXTMBR(QpToMbr) 000027
000028 EXTFILE('QTEMP/QRPGLESRC2') 000028
000029 RENAME(QRPGLESRC2:OUTREC) 000029
000030 USROPN; 000030
*--------------------------------------------------------------------------------------------*
* RPG name External name *
* File name. . . . . . . . . : QRPGLESRC2 CVTRPGFREE/QRPGLESRC2 *
* Record format(s) . . . . . : OUTREC QRPGLESRC2 *
*--------------------------------------------------------------------------------------------*
000031 000031
000032 Dcl-F CVTRPGFREP PRINTER USROPN 000032
000033 OFLIND(overFlow); 000033
*--------------------------------------------------------------------------------------------*
* RPG name External name *
* File name. . . . . . . . . : CVTRPGFREP CVTRPGFREE/CVTRPGFREP *
* Record format(s) . . . . . : Z1PAGHDG Z1PAGHDG *
* Z1TOPPAG Z1TOPPAG *
* ZL01HDG ZL01HDG *
* Z1DETAIL Z1DETAIL *
* Z1ENDRPT Z1ENDRPT *
*--------------------------------------------------------------------------------------------*
000034 000034
000035 //------------------------------------------------------------------------------------------- 000035
000036 // P R O C E D U R E I N T E R F A C E 000036
000037 //------------------------------------------------------------------------------------------- 000037
000038 000038
000039 Dcl-PR CVTRPGFREE EXTPGM('CVTRPGFREE'); 000039
000040 QpShutDown Char(1) CONST; 000040
000041 QpFromFile Char(10) CONST; 000041
000042 QpFromLib Char(10) CONST; 000042
000043 QpFromMember Char(10) CONST; 000043
000044 QpToFile Char(10) CONST; 000044
000045 000045
000046 QpToLib Char(10) CONST; 000046
000047 QpToMbr Char(10) CONST; 000047
000048 QpIndComment Char(1) CONST; 000048
000049 QpRetBlnkCmt Char(1) CONST; 000049
000050 QpDirectives Char(1) CONST; 000050
000051 End-PR; 000051
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 5
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000052 000052
000053 Dcl-PI CVTRPGFREE; 000053
======> aaaaaaaaaa
*RNF3776 10 a 000053 External program on prototype for main procedure is not the
same as program being created.
000054 QpShutDown Char(1) CONST; 000054
000055 QpFromFile Char(10) CONST; 000055
000056 QpFromLib Char(10) CONST; 000056
000057 QpFromMbr Char(10) CONST; 000057
000058 QpToFile Char(10) CONST; 000058
000059 QpToLib Char(10) CONST; 000059
000060 QpToMbr Char(10) CONST; 000060
000061 QpIndComment Char(1) CONST; 000061
000062 QpRetBlnkCmt Char(1) CONST; 000062
000063 QpDirectives Char(1) CONST; 000063
000064 End-PI; 000064
000065 000065
000066 //------------------------------------------------------------------------------------------- 000066
000067 // P R O T O T Y P E I N T E R F A C E S 000067
000068 //------------------------------------------------------------------------------------------- 000068
000069 Dcl-PR GetDeclarationType; 000069
000070 QpDeclType Char( 2 ); 000070
000071 QpSavedName Char( 80 ); 000071
000072 QpDeclLine Like(SRCSEQ); 000072
000073 End-PR; 000073
000074 000074
000075 //------------------------------------------------------------------------------------------- 000075
000076 // N A M E D C O N S T A N T S 000076
000077 //------------------------------------------------------------------------------------------- 000077
000078 Dcl-C LO 'abcdefghijklmnopqrstuvwxyz'; 000078
000079 Dcl-C UP 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 000079
000080 Dcl-C VALIDSPECS 'HFDCP'; 000080
000081 000081
000082 //------------------------------------------------------------------------------------------- 000082
000083 // D A T A S T R U C T U R E S 000083
000084 //------------------------------------------------------------------------------------------- 000084
000085 000085
000086 Dcl-DS SourceData; 000086
000087 SRCDTA Char(100); 000087
000088 prefix Char(5) OVERLAY(SRCDTA:1); 000088
000089 lineType Char(1) OVERLAY(SRCDTA:6); 000089
000090 directive Char(10) OVERLAY(SRCDTA:7); 000090
000091 codeLine Char(93) OVERLAY(SRCDTA:8); 000091
000092 fullLine Char(94) OVERLAY(SRCDTA:7); 000092
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 6
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000093 000093
000094 condNot Char(1) OVERLAY(SRCDTA:9); 000094
000095 condInd Char(2) OVERLAY(SRCDTA:10); 000095
000096 factor1 Char(14) OVERLAY(SRCDTA:12); 000096
000097 opCode Char(10) OVERLAY(SRCDTA:26); 000097
000098 factor2 Char(14) OVERLAY(SRCDTA:36); 000098
000099 result Char(14) OVERLAY(SRCDTA:50); 000099
000100 len Char(5) OVERLAY(SRCDTA:64); 000100
000101 dec Char(2) OVERLAY(SRCDTA:69); 000101
000102 hi Char(2) OVERLAY(SRCDTA:71); 000102
000103 lw Char(2) OVERLAY(SRCDTA:73); 000103
000104 eq Char(2) OVERLAY(SRCDTA:75); 000104
000105 comment Char(20) OVERLAY(SRCDTA:81); 000105
000106 000106
000107 extFactor2 Char(45) OVERLAY(SRCDTA:36); 000107
000108 000108
000109 nonPrefix Char(95) OVERLAY(SRCDTA:6); 000109
000110 000110
000111 procType Char(1) OVERLAY(SRCDTA:24); 000111
000112 procKeyWords Char(37) OVERLAY(SRCDTA:44); 000112
000113 000113
000114 declName Char(15) OVERLAY(SRCDTA:7); 000114
000115 declExt Char(1) OVERLAY(SRCDTA:22); 000115
000116 declPrefix Char(1) OVERLAY(SRCDTA:23); 000116
000117 declType Char(2) OVERLAY(SRCDTA:24); 000117
000118 declSuffix Char(1) OVERLAY(SRCDTA:26); 000118
000119 declFrom Char(7) OVERLAY(SRCDTA:26); 000119
000120 declLen Char(7) Overlay(SRCDTA:33); 000120
000121 declAttr Char(1) Overlay(SRCDTA:40); 000121
000122 declScale Char(3) Overlay(SRCDTA:41); 000122
000123 declKeyWords Char(37) OVERLAY(SRCDTA:44); 000123
000124 declOptions Char(73) Overlay(SRCDTA:7); 000124
000125 000125
000126 FileSpec Char(100) Overlay(SRCDTA:1); 000126
000127 fileName Char(10) Overlay(FileSpec:7); 000127
000128 fileUsage Char(1) Overlay(FileSpec:17); 000128
000129 fileDesig Char(1) Overlay(FileSpec:18); 000129
000130 fileAdd Char(1) Overlay(FileSpec:20); 000130
000131 fileExternal Char(1) Overlay(FileSpec:22); 000131
000132 fileKeyed Char(1) Overlay(FileSpec:34); 000132
000133 fileDevice Char(7) Overlay(FileSpec:36); 000133
000134 fileKeywords Char(37) Overlay(FileSpec:44); 000134
000135 End-DS; 000135
000136 000136
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 7
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000137 // Display file indicators ------------------------------------------------------------------ 000137
000138 Dcl-DS IndicatorDS; 000138
000139 // 01-30: Function keys 000139
000140 // 31-59: Conditioning indicators (error) 000140
000141 // 60-89: Conditioning indicators (non-error) 000141
000142 // 90-99: General indicators 000142
000143 // Report file indicators ------------------------------------------------------------------- 000143
000144 // 01-79: Conditioning indicators (non-error) 000144
000145 cndIndicators Ind Pos(01) DIM(79); 000145
000146 // 80-89: Report control 000146
000147 overFlow Ind Pos(80); 000147
000148 // 90-99: General indicators 000148
000149 errorInd Ind Pos(99) INZ(*OFF); // Global error 000149
000150 End-DS; 000150
000151 000151
000152 Dcl-DS DCLPR QUALIFIED; 000152
000153 decl Char(7) INZ('Dcl-PR '); 000153
000154 procName Char(16); 000154
000155 type Char(9); 000155
000156 definition Char(37); 000156
000157 comment Char(23); 000157
000158 fieldName Char(23) Pos(4); 000158
000159 End-DS; 000159
000160 000160
000161 Dcl-DS DCLP QUALIFIED; // Test comment 000161
000162 decl Char(9) INZ('Dcl-Proc '); 000162
000163 definition Char(61); 000163
000164 comment Char(23); 000164
000165 End-DS; 000165
000166 000166
000167 Dcl-DS DCLS QUALIFIED; 000167
000168 decl Char(6) INZ('Dcl-S '); 000168
000169 fieldName Char(17); 000169
000170 type Char(9); 000170
000171 definition Char(37); 000171
000172 comment Char(23); 000172
000173 End-DS; 000173
000174 000174
000175 Dcl-DS DCLF QUALIFIED; 000175
000176 decl Char(6) INZ('Dcl-F '); 000176
000177 fileName Char(15); 000177
000178 device Char(8); 000178
000179 definition Char(44); 000179
000180 comment Char(23) Pos(70); 000180
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 8
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000181 End-DS; 000181
000182 000182
000183 Dcl-DS DCLH QUALIFIED; 000183
000184 decl Char(8) INZ('Ctl-Opt '); 000184
000185 options Char(62); 000185
000186 comment Char(23); 000186
000187 End-DS; 000187
000188 000188
000189 //------------------------------------------------------------------------------------------- 000189
000190 // S T A N D - A L O N E V A R I A B L E S 000190
000191 //------------------------------------------------------------------------------------------- 000191
000192 // Template variables (required - do not alter). 000192
000193 Dcl-S cfgCommitControl // Test comment 000193
000194 Char(7) INZ('*SLAVE '); // *MASTER/*SLAVE 000194
000195 Dcl-S cfgCloseDown Char(1) INZ('N'); // Close down program? 000195
000196 Dcl-S initialCall Char(1) INZ(*Blank); 000196
000197 000197
000198 // End of Template variables (required - do not alter). 000198
000199 //------------------------------------------------------------------------------------------- 000199
000200 Dcl-S QopCodeUP Char(10) DIM(66) PERRCD(1) CTDATA; 000200
000201 Dcl-S QopCodeLO Char(10) DIM(66) ALT(QopCodeUP); 000201
000202 Dcl-S QdeclUP Char(10) DIM(12) PERRCD(1) CTDATA; 000202
000203 Dcl-S QdeclLO Char(10) DIM(12) ALT(QdeclUP); 000203
000204 Dcl-S Qcomments Char(92) DIM(3) CTDATA; 000204
000205 Dcl-S x Packed(5:0); 000205
000206 Dcl-S y Packed(5:0); 000206
000207 Dcl-S i Packed(5:0); 000207
000208 Dcl-S j Packed(5:0); 000208
000209 Dcl-S blanks Char(30) INZ(*Blanks); 000209
000210 Dcl-S maxIndent Packed(5:0) INZ(15); 000210
000211 Dcl-S movedDefs LIKE(result) DIM(9999); 000211
000212 Dcl-S moveDef Ind INZ(*Off); 000212
000213 000213
000214 Dcl-S fromFileLib Char(21); 000214
000215 Dcl-S toFileLib Char(21); 000215
000216 000216
000217 Dcl-S operator Char(10); 000217
000218 Dcl-S operatorEnd Packed(5:0); 000218
000219 Dcl-S newOperator VarChar(10); 000219
000220 Dcl-S nonConvRsn LIKE(codeLine); 000220
000221 000221
000222 Dcl-S inCode Ind INZ(*Off); 000222
000223 Dcl-S inArrayData Ind INZ(*Off); 000223
000224 Dcl-S inComment Ind INZ(*Off); 000224
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 9
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000225 Dcl-S inDeclaration Ind INZ(*Off); 000225
000226 Dcl-S inPrototype Ind INZ(*Off); 000226
000227 Dcl-S inInterface Ind INZ(*Off); 000227
000228 Dcl-S inDatastructure 000228
000229 Ind INZ(*Off); 000229
000230 Dcl-S inExtProc Ind INZ(*Off); 000230
000231 Dcl-S endDS Ind INZ(*Off); 000231
000232 Dcl-S inDirective Ind INZ(*Off); 000232
000233 Dcl-S inFreeFormat Ind INZ(*On); 000233
000234 Dcl-S inDeclProc Ind INZ(*Off); 000234
000235 Dcl-S indent Ind INZ(*Off); 000235
000236 Dcl-S inSpan Ind INZ(*Off); 000236
000237 Dcl-S inCase Ind INZ(*Off); 000237
000238 Dcl-S convert Ind INZ(*Off); 000238
000239 Dcl-S unindent Ind INZ(*Off); 000239
000240 Dcl-S defsMoved Ind INZ(*Off); 000240
000241 Dcl-S dropLine Ind INZ(*Off); 000241
000242 Dcl-S codeStart LIKE(SRCSEQ) INZ(0); 000242
000243 Dcl-S endLine LIKE(SRCSEQ) INZ(0); // Close struct here. 000243
000244 Dcl-S endFound Ind; 000244
000245 Dcl-S endDeclType Char(2); 000245
000246 000246
000247 Dcl-S savedLineType Char(1); 000247
000248 000248
000249 Dcl-S increment Packed(1:0) INZ(0); 000249
000250 Dcl-S indentCount Packed(5:0) INZ(0); 000250
000251 Dcl-S indentSize Packed(1:0) INZ(3); 000251
000252 Dcl-S indentOffset Packed(5:0) INZ(0); 000252
000253 Dcl-S prevOffset Packed(5:0) INZ(0); 000253
000254 Dcl-S currOffset Packed(5:0) INZ(0); 000254
000255 Dcl-S lineEnd Packed(5:0) INZ(0); 000255
000256 Dcl-S mainlineIndent Packed(5:0) INZ(1); 000256
000257 000257
000258 Dcl-S savedSRCDTA LIKE(SRCDTA); 000258
000259 Dcl-S sourceLine Char(93); 000259
000260 Dcl-S overflowLine VarChar(92); 000260
000261 Dcl-S workDirective Char(10); 000261
000262 Dcl-S workLineType Char(1); 000262
000263 Dcl-S workDeclType Char(2); 000263
000264 Dcl-S workDeclAttr Char(1); 000264
000265 Dcl-S workDeclName Char(50); 000265
000266 Dcl-S workDeclLine LIKE(SRCSEQ); 000266
000267 Dcl-S workDeclKeywords VarChar(92); 000267
000268 000268
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 10
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000269 Dcl-S tempDeclType Char(2); 000269
000270 Dcl-S tempDeclLine LIKE(SRCSEQ); 000270
000271 Dcl-S tempSavedName Char(80); 000271
000272 000272
000273 Dcl-S workFileUsage Char(1); 000273
000274 Dcl-S workFileDesig Char(1); 000274
000275 Dcl-S workFileAdd Char(1); 000275
000276 Dcl-S workFileKeyed Char(1); 000276
000277 Dcl-S workFileDevice Char(7); 000277
000278 Dcl-S checkLength Packed(5:0); 000278
000279 Dcl-S workLength Packed(7:0); 000279
000280 000280
000281 Dcl-S savedComment Char(20); 000281
000282 Dcl-S savedName Char(80); 000282
000283 000283
000284 Dcl-S padResult Ind INZ(*Off); 000284
000285 Dcl-S padTarget LIKE(result); 000285
000286 000286
000287 Dcl-S scanString LIKE(factor1); 000287
000288 Dcl-S scanBase LIKE(factor2); 000288
000289 Dcl-S scanLength Char(10); 000289
000290 Dcl-S scanStart Char(10); 000290
000291 Dcl-S scanNoResult Ind INZ(*Off); 000291
000292 000292
000293 Dcl-S substLen Char(10); 000293
000294 Dcl-S substStart Char(10); 000294
000295 000295
000296 Dcl-S setOff Ind INZ(*Off); 000296
000297 Dcl-S setOffInd1 Char(2); 000297
000298 Dcl-S setOffInd2 Char(2); 000298
000299 Dcl-S setOffInd3 Char(2); 000299
000300 000300
000301 Dcl-S setOn Ind INZ(*Off); 000301
000302 Dcl-S setOnInd1 Char(2); 000302
000303 Dcl-S setOnInd2 Char(2); 000303
000304 Dcl-S setOnInd3 Char(2); 000304
000305 000305
000306 Dcl-S xlateFrom LIKE(factor1); 000306
000307 Dcl-S xlateTo LIKE(factor1); 000307
000308 Dcl-S xlateBase LIKE(factor2); 000308
000309 Dcl-S xlateStart Char(10); 000309
000310 000310
000311 Dcl-S caseSubRoutine Char(10); 000311
000312 Dcl-S caseOperator Char(4); 000312
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 11
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000313 000313
000314 Dcl-S catFactor1 LIKE(factor1); 000314
000315 Dcl-S catFactor2 LIKE(factor2); 000315
000316 Dcl-S catCount Packed(5:0) INZ(0); 000316
000317 Dcl-S catBlanks LIKE(factor2); 000317
000318 000318
000319 Dcl-S durDuration LIKE(factor2); 000319
000320 Dcl-S durCode LIKE(factor2); 000320
000321 Dcl-S durNewDate Ind INZ(*Off); 000321
000322 000322
000323 Dcl-S inEval Ind INZ(*Off); 000323
000324 Dcl-S evalOperator Like(opCode); 000324
000325 Dcl-S evalOffset Packed(5:0); 000325
000326 000326
000327 Dcl-S inCallP Ind INZ(*Off); 000327
000328 Dcl-S callPOperator Like(opCode); 000328
000329 Dcl-S callPOffset Packed(5:0); 000329
000330 000330
000331 Dcl-S inDo Ind INZ(*Off); 000331
000332 Dcl-S doOperator Like(opCode); 000332
000333 Dcl-S doCompare Char(2); 000333
000334 000334
000335 Dcl-S inIf Ind INZ(*Off); 000335
000336 Dcl-S ifOperator Like(opCode); 000336
000337 Dcl-S ifCompare Char(2); 000337
000338 000338
000339 Dcl-S inWhen Ind INZ(*Off); 000339
000340 Dcl-S whenOperator Like(opCode); 000340
000341 Dcl-S whenCompare Char(2); 000341
000342 000342
000343 Dcl-S inSQL Ind INZ(*Off); 000343
000344 000344
000345 Dcl-S forCount Packed(5:0) INZ(0); 000345
000346 Dcl-S forLevel Packed(5:0) DIM(99); // Allow for 99 000346
000347 Dcl-S forFactor1 LIKE(factor1); 000347
000348 Dcl-S forFactor2 LIKE(factor2); 000348
000349 000349
000350 Dcl-S doCount Packed(5:0) INZ(0); 000350
000351 Dcl-S doLevel Packed(5:0) DIM(99); // Allow for 99 000351
000352 000352
000353 Dcl-S slCount Packed(5:0) INZ(0); 000353
000354 Dcl-S slLevel Packed(5:0) DIM(99); // Allow for 99 000354
000355 000355
000356 Dcl-S divFactor1 LIKE(factor1); 000356
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 12
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000357 Dcl-S divFactor2 LIKE(factor2); 000357
000358 000358
000359 Dcl-S ERRCheck Ind INZ(*Off); 000359
000360 Dcl-S ERRInd Char(2); 000360
000361 000361
000362 Dcl-S foundCheck Ind INZ(*Off); 000362
000363 Dcl-S foundInd Char(2); 000363
000364 000364
000365 Dcl-S NRFCheck Ind INZ(*Off); 000365
000366 Dcl-S NRFInd Char(2); 000366
000367 Dcl-S NRFFile LIKE(factor2); 000367
000368 000368
000369 Dcl-S EOFCheck Ind INZ(*Off); 000369
000370 Dcl-S EOFInd Char(2); 000370
000371 Dcl-S EOFFile LIKE(factor2); 000371
000372 000372
000373 Dcl-S HICheck Ind INZ(*Off); 000373
000374 Dcl-S HIInd Char(2); 000374
000375 Dcl-S HiFactor1 LIKE(factor1); 000375
000376 Dcl-S HiFactor2 LIKE(factor2); 000376
000377 000377
000378 Dcl-S LWCheck Ind INZ(*Off); 000378
000379 Dcl-S LWInd Char(2); 000379
000380 Dcl-S LWFactor1 LIKE(factor1); 000380
000381 Dcl-S LWFactor2 LIKE(factor2); 000381
000382 000382
000383 Dcl-S EQCheck Ind INZ(*Off); 000383
000384 Dcl-S EQInd Char(2); 000384
000385 Dcl-S EQFactor1 LIKE(factor1); 000385
000386 Dcl-S EQFactor2 LIKE(factor2); 000386
000387 000387
000388 Dcl-S equalCheck Ind INZ(*Off); 000388
000389 Dcl-S equalInd Char(2); 000389
000390 000390
000391 Dcl-S countSource Packed(7:0) INZ(0); 000391
000392 Dcl-S countTarget Packed(7:0) INZ(0); 000392
000393 Dcl-S countEligible Packed(7:0) INZ(0); 000393
000394 Dcl-S countConv Packed(7:0) INZ(0); 000394
000395 Dcl-S countNotConv Packed(7:0) INZ(0); 000395
000396 Dcl-S countMoved Packed(7:0) INZ(0); 000396
000397 000397
000398 //Dcl-S testb BinDec(2:0); 000398
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 13
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000400 //------------------------------------------------------------------------------------------- 000400
000401 // Main Procedure 000401
000402 //------------------------------------------------------------------------------------------- 000402
000403 // Initialize 000403
000001=ISRCREC 1000001
*--------------------------------------------------------------------------------------------* 1
* RPG record format . . . . : SRCREC * 1
* External format . . . . . : QRPGLESRC : CVTRPGFREE/QRPGLESRC * 1
*--------------------------------------------------------------------------------------------* 1
000002=I S 1 6 2SRCSEQ 1000002
000003=I S 7 12 0SRCDAT 1000003
000004=I A 13 112 SRCDTA 1000004
000404 Exsr subInitialise; 000404
000405 000405
000406 // Perform required function 000406
000407 Exsr subUserFunction; 000407
000408 000408
000409 // Terminate the program. 000409
000410 Exsr subExitProgram; 000410
000411 //------------------------------------------------------------------------------------------- 000411
000412 000412
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 14
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000414 //------------------------------------------------------------------------------------------- 000414
000415 // USER: Perform required function. 000415
000416 //------------------------------------------------------------------------------------------- 000416
000417 BegSr subUserFunction; 000417
000418 000418
000419 // ** Code the necessary processing here. 000419
000420 // >>>>> Start of User-Point >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 000420
000421 000421
000422 // Read through the source member. 000422
000423 Read SRCREC; 000423
000424 000424
000425 DoW not %eof(QRPGLESRC); B01 000425
000426 countSource += 1; 01 000426
000427 000427
000428 Exsr subUserReformatLine; 01 000428
000429 000429
000430 Exsr subUserSetIndicators; 01 000430
000431 000431
000432 // Old-style SCAN without a result field. 000432
000433 If scanNoResult; B02 000433
000434 Clear nonPrefix; 02 000434
000435 000435
000436 codeLine = '// Old-style SCAN without a result!'; 02 000436
000437 Exsr subUserReformatLine; 02 000437
000438 codeLine = 'EndIf;'; 02 000438
000439 Exsr subUserReformatLine; 02 000439
000440 000440
000441 scanNoResult = *Off; 02 000441
000442 EndIf; E02 000442
000443 000443
000444 // If in a CAS statement, record the subroutine to call. 000444
000445 If inCase and caseSubroutine <> *Blanks; B02 000445
000446 codeLine = 'ExSr ' + %trim(caseSubRoutine) + ';'; 02 000446
000447 Exsr subUserReformatLine; 02 000447
000448 caseSubRoutine = *Blanks; 02 000448
000449 EndIf; E02 000449
000450 000450
000451 Read SRCREC; 01 000451
000452 EndDo; E01 000452
000453 000453
000454 // Handle overflow. 000454
000455 If overFlow; B01 000455
000456 000456
000457 // Print page headings. 000457
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 15
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000458 Z1QPAG += 1; 01 000458
000459 Write Z1PAGHDG; 01 000459
000460 000460
000461 ZTFRFL = fromFileLib; 01 000461
000462 ZTTOFL = toFileLib; 01 000462
000463 000463
000464 Write Z1TOPPAG; 01 000464
000465 000465
000466 overFlow = *Off; 01 000466
000467 EndIf; E01 000467
000468 000468
000469 Z1FRMB = QpFromMbr; 000469
000470 Z1TOMB = QpToMbr; 000470
000471 Z1CTSC = countSource; 000471
000472 Z1CTTG = countTarget; 000472
000473 Z1CTEL = countEligible; 000473
000474 Z1CTCV = countConv; 000474
000475 Z1CTNV = countNotConv; 000475
000476 Z1CTMV = countMoved; 000476
000477 If countEligible = 0; B01 000477
000478 Z1CNVR = 0; 01 000478
000479 Else; X01 000479
000480 Z1CNVR = countConv * 100 / countEligible; 01 000480
000481 EndIf; E01 000481
000482 000482
000483 // Print detail format. 000483
000484 Write Z1DETAIL; 000484
000485 000485
000486 // <<<<< End of User-Point <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 000486
000487 000487
000488 EndSr; 000488
000489 //------------------------------------------------------------------------------------------- 000489
000490 000490
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 16
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000492 //------------------------------------------------------------------------------------------- 000492
000493 // Perform conversion/reformatting on the current line. 000493
000494 //------------------------------------------------------------------------------------------- 000494
000495 BegSr subUserReformatLine; 000495
000496 000496
000497 inDirective = *Off; 000497
000498 inComment = *Off; 000498
000499 increment = 0; 000499
000500 000500
000501 workDirective = %xlate(lo:up:directive); 000501
000502 workLineType = %xlate(lo:up:lineType); 000502
000503 000503
000504 convert = *Off; 000504
000505 nonConvRsn = *Blanks; 000505
000506 000506
000507 sourceLine = codeLine; // Start with what is already there. 000507
000508 000508
000509 // Array data reached? 000509
000510 If %subst(prefix:1:3) = '** ' B01 000510
000511 or %subst(SRCDTA:1:8) = '**CTDATA'; B01 000511
000512 inCode = *Off; 01 000512
000513 inDeclaration = *Off; 01 000513
000514 inArrayData = *On; 01 000514
000515 EndIf; E01 000515
000516 000516
000517 If not inArrayData; B01 000517
000518 //---------------------------------------------------------------------------------- 000518
000519 // Determine Line Type 000519
000520 If workLineType = 'C'; // C-Spec B02 000520
000521 inCode = *On; 02 000521
000522 // ElseIf workLineType = 'P' // P-Spec 000522
000523 // or %len(%trim(codeLine)) >= 4 000523
000524 // and %xlate(lo:up:%subst(%trim(codeLine):1:4)) = 'DCL-'; 000524
000525 // inCode = *Off; 000525
000526 // defsMoved = *Off; 000526
000527 ElseIf workLineType = 'P'; // P-Spec X02 000527
000528 inCode = *Off; 02 000528
000529 defsMoved = *Off; 02 000529
000530 ElseIf workLineType = 'D'; // Declaration. X02 000530
000531 inCode = *Off; 02 000531
000532 ElseIf workLineType = 'H'; // Header spec. X02 000532
000533 inCode = *Off; 02 000533
000534 ElseIf workLineType = 'F'; // File spec. X02 000534
000535 inCode = *Off; 02 000535
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 17
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000536 ElseIf workLineType = 'O'; // O-Spec X02 000536
000537 inCode = *Off; 02 000537
000538 ElseIf workLineType = 'I'; // I-Spec X02 000538
000539 inCode = *On; 02 000539
000540 ElseIf %check(validSpecs:workLineType) <> 0; // Invalid spec type. X02 000540
000541 workLineType = *Blanks; 02 000541
000542 lineType = *Blank; // Clear it! 02 000542
000543 EndIf; E02 000543
000544 000544
000545 If %trim(workDirective) = '/FREE'; B02 000545
000546 // In a free-format directive, so we must be in code too. 000546
000547 If not inFreeFormat; B03 000547
000548 inDirective = *On; 03 000548
000549 inCode = *On; 03 000549
000550 inFreeFormat = *On; 03 000550
000551 lineType = ' '; 03 000551
000552 workLineType = ' '; 03 000552
000553 If QpDirectives = 'Y'; B04 000553
000554 directive = '/Free'; 04 000554
000555 Else; X04 000555
000556 dropLine = *On; 04 000556
000557 EndIf; E04 000557
000558 Else; X03 000558
000559 dropLine = *On; // Not needed. 03 000559
000560 EndIf; E03 000560
000561 ElseIf %trim(workDirective) = '/END-FREE'; X02 000561
000562 // At the end of a directive, so we can't be in free format any more. 000562
000563 //inDirective = *On; 000563
000564 //directive = '/End-Free'; 000564
000565 //inFreeFormat = *Off; 000565
000566 dropLine = *On; 02 000566
000567 ElseIf %trim(workDirective) = '/EJECT'; X02 000567
000568 inDirective = *On; 02 000568
000569 lineType = ' '; 02 000569
000570 workLineType = ' '; 02 000570
000571 ElseIf %subst(workDirective:1:5) = '/COPY'; X02 000571
000572 inDirective = *On; 02 000572
000573 lineType = ' '; 02 000573
000574 workLineType = ' '; 02 000574
000575 ElseIf %subst(workDirective:1:3) = '/IF'; X02 000575
000576 inDirective = *On; 02 000576
000577 lineType = ' '; 02 000577
000578 workLineType = ' '; 02 000578
000579 ElseIf %subst(workDirective:1:6) = '/ENDIF'; X02 000579
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 18
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000580 inDirective = *On; 02 000580
000581 lineType = ' '; 02 000581
000582 workLineType = ' '; 02 000582
000583 ElseIf %subst(workDirective:1:7) = '/DEFINE'; X02 000583
000584 inDirective = *On; 02 000584
000585 lineType = ' '; 02 000585
000586 workLineType = ' '; 02 000586
000587 ElseIf %subst(workDirective:1:6) = '/SPACE'; X02 000587
000588 inDirective = *On; 02 000588
000589 lineType = ' '; 02 000589
000590 workLineType = ' '; 02 000590
000591 ElseIf %subst(workDirective:1:6) = '/TITLE'; X02 000591
000592 inDirective = *On; 02 000592
000593 lineType = ' '; 02 000593
000594 workLineType = ' '; 02 000594
000595 ElseIf (%subst(workDirective:1:1) = '*' X02 000595
000596 or %subst(workDirective:1:2) = '//') X02 000596
000597 and (lineType = *Blank or inCode); X02 000597
000598 // and inCode; 000598
000599 // This is a comment line. 000599
000600 If QpIndComment <> 'Y' or workLineType = 'C'; B03 000600
000601 inComment = *On; 03 000601
000602 EndIf; E03 000602
000603 If %subst(workDirective:1:2) = '//'; B03 000603
000604 %subst(directive:1:2) = ' '; 03 000604
000605 Else; X03 000605
000606 %subst(directive:1:1) = ' '; 03 000606
000607 EndIf; E03 000607
000608 If workLineType = 'C' or workLineType = 'D'; B03 000608
000609 lineType = ' '; 03 000609
000610 workLineType = ' '; 03 000610
000611 EndIf; E03 000611
000612 // Retain blank comment markers? 000612
000613 If QpRetBlnkCmt = 'N' and %len(%trim(codeLine)) = 0; B03 000613
000614 // Leave the line blank, devoid of any marker. 000614
000615 Else; X03 000615
000616 codeLine = '//' + codeLine; 03 000616
000617 EndIf; E03 000617
000618 ElseIf %subst(workDirective:1:1) = '*'; X02 000618
000619 // and workLineType = 'O'; 000619
000620 // Leave the line as it is. 000620
000621 inComment = *On; 02 000621
000622 ElseIf %len(%trim(codeLine)) = 0; X02 000622
000623 // Just a 'spacer' line - keep it but drop the line type. 000623
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 19
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000624 lineType = ' '; 02 000624
000625 workLineType = ' '; 02 000625
000626 ElseIf %len(%trim(codeLine)) >= 2 X02 000626
000627 and %subst(%trim(codeLine):1:2) = '//' X02 000627
000628 and (workLineType = *Blank or inCode); X02 000628
000629 // This is a comment line. 000629
000630 If QpIndComment <> 'Y' or workLineType = 'C'; B03 000630
000631 inComment = *On; 03 000631
000632 EndIf; E03 000632
000633 // Retain blank comment markers? 000633
000634 If QpRetBlnkCmt = 'N' and %len(%trim(%subst(codeLine:3))) B03 000634
000635 = 0; B03 000635
000636 // Leave the line blank, devoid of any marker. 000636
000637 codeLine = *Blanks; 03 000637
000638 EndIf; E03 000638
000639 ElseIf comment <> *Blanks X02 000639
000640 and %len(%trim(%subst(codeLine:1:73))) = 0; X02 000640
000641 // This is a blank line with a comment section. 000641
000642 %subst(codeLine:71:2) = '//'; 02 000642
000643 inComment = *On; 02 000643
000644 EndIf; E02 000644
000645 000645
000646 //---------------------------------------------------------------------------------- 000646
000647 // Convert fixed-format to free-format? 000647
000648 If not inComment B02 000648
000649 and not inDirective; B02 000649
000650 000650
000651 If workLineType = 'C'; B03 000651
000652 countEligible += 1; 03 000652
000653 countNotConv += 1; 03 000653
000654 operator = %xlate(lo:up:opCode); 03 000654
000655 savedComment = comment; 03 000655
000656 000656
000657 Exsr subUserConvertC_Spec; 03 000657
000658 000658
000659 If not inComment and not convert B04 000659
000660 and not dropLine and nonConvRsn = *Blanks; B04 000660
000661 nonConvRsn = 'Conversion not currently supported.'; 04 000661
000662 EndIf; E04 000662
000663 000663
000664 ElseIf workLineType = 'P'; // Procedure start/end. X03 000664
000665 countEligible += 1; 03 000665
000666 countNotConv += 1; 03 000666
000667 operator = *Blanks; 03 000667
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 20
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000668 savedComment = comment; 03 000668
000669 000669
000670 Exsr subUserConvertP_Spec; 03 000670
000671 000671
000672 If not inComment and not convert B04 000672
000673 and not dropLine and nonConvRsn = *Blanks; B04 000673
000674 nonConvRsn = 'Conversion not currently supported.'; 04 000674
000675 EndIf; E04 000675
000676 000676
000677 ElseIf workLineType = 'D'; // Declaration. X03 000677
000678 countEligible += 1; 03 000678
000679 countNotConv += 1; 03 000679
000680 savedComment = comment; 03 000680
000681 000681
000682 Exsr subUserConvertD_Spec; 03 000682
000683 000683
000684 If not inComment and not convert B04 000684
000685 and not dropLine and nonConvRsn = *Blanks; B04 000685
000686 //nonConvRsn = 'Conversion not currently supported.'; 000686
000687 EndIf; E04 000687
000688 000688
000689 ElseIf workLineType = 'F'; // File. X03 000689
000690 countEligible += 1; 03 000690
000691 countNotConv += 1; 03 000691
000692 savedComment = comment; 03 000692
000693 000693
000694 Exsr subUserConvertF_Spec; 03 000694
000695 000695
000696 If not inComment and not convert B04 000696
000697 and not dropLine and nonConvRsn = *Blanks; B04 000697
000698 //nonConvRsn = 'Conversion not currently supported.'; 000698
000699 EndIf; E04 000699
000700 000700
000701 ElseIf workLineType = 'H'; // Header. X03 000701
000702 countEligible += 1; 03 000702
000703 countNotConv += 1; 03 000703
000704 savedComment = comment; 03 000704
000705 000705
000706 Exsr subUserConvertH_Spec; 03 000706
000707 000707
000708 If not inComment and not convert B04 000708
000709 and not dropLine and nonConvRsn = *Blanks; B04 000709
000710 //nonConvRsn = 'Conversion not currently supported.'; 000710
000711 EndIf; E04 000711
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 21
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000712 000712
000713 ElseIf workLineType = 'O'; // Output spec X03 000713
000714 sourceLine = fullLine; 03 000714
000715 000715
000716 ElseIf workLineType = 'I'; // Input spec X03 000716
000717 sourceLine = fullLine; 03 000717
000718 000718
000719 ElseIf workLineType = ' ' and inCode; X03 000719
000720 inFreeFormat = *On; 03 000720
000721 // When in an IF we usually want subsequent lines to be pulled back to be 000721
000722 // in line with the 'If', but only if those lines start with either 'and' 000722
000723 // or 'or'. Otherwise we retain the existing indentation by turning on 000723
000724 // inSpan. 000724
000725 If inIf and %len(%trim(codeLine)) >= 3 B04 000725
000726 and %xlate(lo:up:%subst(%trim(codeLine):1:3)) <> 'AND' B04 000726
000727 and %xlate(lo:up:%subst(%trim(codeLine):1:3)) <> 'OR '; B04 000727
000728 inSpan = *On; 04 000728
000729 EndIf; E04 000729
000730 If inSpan; B04 000730
000731 currOffset = %check(' ':codeLine); // Offset of the continuation line. 04 000731
000732 Else; X04 000732
000733 prevOffset = %check(' ':codeLine); // Offset of the parent line. 04 000733
000734 EndIf; E04 000734
000735 sourceLine = %trim(codeLine); // Free-format already, so trim it. 03 000735
000736 Else; X03 000736
000737 inFreeFormat = *On; 03 000737
000738 sourceLine = %trimr(codeLine); // None of the above, use the raw source 03 000738
000739 EndIf; E03 000739
000740 000740
000741 // Converted? 000741
000742 If convert; B03 000742
000743 countConv += 1; 03 000743
000744 countNotConv -= 1; 03 000744
000745 // Switch to free-format? 000745
000746 If not inFreeFormat and not inDeclaration; B04 000746
000747 If QpDirectives = 'Y'; B05 000747
000748 savedSRCDTA = SRCDTA; 05 000748
000749 Clear SRCDTA; 05 000749
000750 directive = '/Free'; 05 000750
000751 Exsr subUserWriteLine; 05 000751
000752 SRCDTA = savedSRCDTA; 05 000752
000753 EndIf; E05 000753
000754 inFreeFormat = *On; 04 000754
000755 directive = *Blanks; 04 000755
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 22
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000756 EndIf; E04 000756
000757 EndIf; E03 000757
000758 000758
000759 // Revert to fixed-format? 000759
000760 If not convert and (lineType <> *Blanks B03 000760
000761 or %subst(workDirective:1:5) = '/COPY'); B03 000761
000762 // or %subst(prefix:1:3) = '** '); // Array data reached 000762
000763 If inFreeFormat and not inDeclaration; B04 000763
000764 If QpDirectives = 'Y'; B05 000764
000765 savedSRCDTA = SRCDTA; 05 000765
000766 Clear SRCDTA; 05 000766
000767 directive = '/End-Free'; 05 000767
000768 Exsr subUserWriteLine; 05 000768
000769 SRCDTA = savedSRCDTA; 05 000769
000770 EndIf; E05 000770
000771 inFreeFormat = *Off; 04 000771
000772 If not inDirective; B05 000772
000773 directive = *Blanks; 05 000773
000774 EndIf; E05 000774
000775 EndIf; E04 000775
000776 // Record the reason for not converting? 000776
000777 If nonConvRsn <> *Blanks; B04 000777
000778 savedSRCDTA = SRCDTA; 04 000778
000779 Clear SRCDTA; 04 000779
000780 codeLine = '// >>>>> Not converted: ' + nonConvRsn; 04 000780
000781 Exsr subUserWriteLine; 04 000781
000782 SRCDTA = savedSRCDTA; 04 000782
000783 EndIf; E04 000783
000784 inSpan = *Off; 03 000784
000785 EndIf; E03 000785
000786 Else; X02 000786
000787 // Use source exactly as is. 000787
000788 sourceLine = codeLine; 02 000788
000789 EndIf; E02 000789
000790 000790
000791 //---------------------------------------------------------------------------------- 000791
000792 // If we are in a code section, check if indent is affected at all. 000792
000793 // If not inDeclaration 000793
000794 // and not inDirective 000794
000795 If not inDirective B02 000795
000796 and not inComment B02 000796
000797 and not dropLine; B02 000797
000798 // Isolate the operator to check indentation against. 000798
000799 //sourceLine = %trimr(codeLine); 000799
5770WDS V7R2M0 140418 RN IBM ILE RPG CVTRPGFREE/CVTRPGFRER DKSRV206 25-06-20 15:32:51 Page 23
Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line Date Id Number
000800 If inFreeFormat; B03 000800
000801 If %subst(sourceLine:1:2) = '//'; // Comment - no operator. B04 000801
000802 operator = *Blanks; 04 000802
000803 ElseIf inSQL; // Embedded SQL - no operator. X04 000803
000804 operator = *Blanks; 04 000804
000805 Else; X04 000805
000806 // Isolate the 'operator' (first word really). 000806
000807 operator = %trim(sourceLine); 04 000807
000808 operatorEnd = %scan(' ':%trim(operator)); // Look for end of first 'word'. 04 000808
000809 If operatorEnd = 0; B05 000809
000810 operatorEnd = %scan(';':operator); // Only one word - is it an operator 05 000810
000811 If operatorEnd = 0; B06 000811
000812 operatorEnd = %scan('(':operator); // Shouldn't match! 06 000812
000813 EndIf; E06 000813
000814 EndIf; E05 000814
000815 // If we have an operator, remove any attached extender code. 000815
000816 If operatorEnd > 0; B05 000816
000817 operator = %subst(operator:1:operatorEnd - 1); 05 000817
000818 // Exec SQL? 000818
000819 If %xlate(lo:up:operator) = 'EXEC'; B06 000819
000820 If %scan('SQL':%xlate(lo:up:%trim(sourceLine)):6) B07 000820
000821 > 0; B07 000821
000822 operator = 'Exec SQL'; 07 000822
000823 inSQL = *On; 07 000823
000824 EndIf; E07 000824
000825 EndIf; E06 000825
000826 operatorEnd = %scan('(':operator); 05 000826
000827 If operatorEnd > 1; B06 000827
000828 operator = %subst(operator:1:operatorEnd - 1); 06 000828
000829 EndIf; E06 000829
000830 EndIf; E05 000830
000831 000831
000832 If %lookup(%xlate(lo:up:operator):QopCodeUP) > 0 B05 000832
000833 and not inDeclaration; B05 000833
000834 inCode = *On; 05 000834
000835 Else; X05 000835
000836 If %lookup(%xlate(lo:up:operator):QdeclUP) > 0; B06 000836
000837 // Declaration! 000837
000838 Else; X06 000838
000839 // Not an operator! 000839