Source Comparison (Why JSON)


Follow up on Why YAJL?
Copying an exiting working program and changing it to another file takes 10 lines of code to change and an additional 3 lines per field on the file to be used.

CMPPFM NEWFILE(QRPGLESRC) NEWMBR(SACBEER1)  OLDFILE(QRPGLESRC) OLDMBR(SACASCR1)


I -        DCL-PR SACBEER1    EXTPGM('SACBEER1');                                   RPL=    1 0000031 0000030
D -        DCL-PR SACASCR1    EXTPGM('SACASCR1');                                                                     
I -        DCL-PI SACBEER1;                                                         RPL=    1 0000033 0000032
D -        DCL-PI SACASCR1;                                                                                           
I -               FIELD       LIKE(FILE_T.SACBEE) CONST;                            RPL=    1 0000044 0000043
D -               FIELD       LIKE(FILE_T.SACASC) CONST;                                                    
I -               SACBEE           ZONED(2:0);                                      INS=    2 0000064      
I -               SACBED           CHAR(100);                                                 0000065      
D -               SACASC           CHAR(2);                                         DEL=    9         0000063
D -               SACASD           CHAR(40);                                                          0000064
D -               SACASF           CHAR(200);                                                         0000065
D -               SACASA           CHAR(3);                                                           0000066
D -               SACASP           CHAR(3);                                                           0000067
D -               SACASE           CHAR(3);                                                           0000068
D -               SACASR           CHAR(3);                                                           0000069
D -               SACASM           CHAR(3);                                                           0000070
D -               SACASB           CHAR(10);                                                          0000071            
I -        DCL-S  API           VARCHAR(10)                        INZ('SACBEER1'); RPL=    1 0000084 0000090
D -        DCL-S  API           VARCHAR(10)                        INZ('SACASCR1');              
I -        DCL-S  FIELD         LIKE(FILE_T.SACBEE);                                RPL=    1 0000086 0000092
D -        DCL-S  FIELD         LIKE(FILE_T.SACASC);                                                                     
I -                 FIELD = %INT(PARAMETER);                                        RPL=    1 0000098 0000104
D -                 FIELD = PARAMETER;                                                                                   
I -                 FIELD = 0;                                                      RPL=    1 0000100 0000106
D -                 FIELD = *BLANKS;                                                                                   
I -                 FIELD       LIKE(FILE_T.SACBEE) CONST;                          RPL=    1 0000147 0000153
D -                 FIELD       LIKE(FILE_T.SACASC) CONST;                                                           
I -           IF FIELD = 0;                                                         RPL=    1 0000151 0000157
D -           IF FIELD = *BLANKS;                                                                                      
I -                      SELECT SACBEE, SACBED, ISODAT, UID                         INS=    3 0000153      
I -                        FROM SACBEEP                                                       0000154      
I -                      ORDER BY SACBEE;                                                     0000155      
D -                      SELECT SACASC, SACASD, SACASF, SACASA, SACASP,             DEL=    4         0000159
D -                      SACASE, SACASR, SACASM, SACASB, ISODAT, UID                                  0000160
D -                        FROM SACASCP                                                               0000161
D -                      ORDER BY SACASC;                                                             0000162              
I -                      SELECT SACBEE, SACBED, ISODAT, UID                         INS=    3 0000160      
I -                        FROM SACBEEP                                                       0000161      
I -                      WHERE SACBEE = :FIELD;                                               0000162      
D -                      SELECT SACASC, SACASD, SACASF, SACASA, SACASP,             DEL=    4         0000167
D -                      SACASE, SACASR, SACASM, SACASB, ISODAT, UID                                  0000168
D -                        FROM SACASCP                                                               0000169
D -                      WHERE SACASC = :FIELD;                                                       0000170         
I -                    DATA.ERRMSG = 'No records found in option file SACBEEP';     RPL=    1 0000172 0000180
D -                    DATA.ERRMSG = 'No records found in option file SACASCP';                                  
I -           IF FIELD = 0;                                                         RPL=    1 0000178 0000186
D -           IF FIELD = *BLANKS;                                                                                    
I -                         YAJL_addNum                                             INS=    2 0000224      
I -                          ('BEEStatusCode'     :%CHAR(DATA.FILE1(X).SACBEE));              0000225      
I -                         ('BEEStatusDescription' :%TRIMR(DATA.FILE1(X).SACBED)); INS=    1 0000227      
D -                          ('StatusCode'        :%TRIMR(DATA.FILE1(X).SACASC));   DEL=   17         0000233
D -                         YAJL_addChar                                                              0000234
D -                          ('StatusDescription' :%TRIMR(DATA.FILE1(X).SACASD));                     0000235
D -                         YAJL_addChar                                                              0000236
D -                          ('StatusDefinition'  :%TRIMR(DATA.FILE1(X).SACASF));                     0000237
D -                         YAJL_addChar                                                              0000238
D -                          ('AdverseClosure'    :%TRIMR(DATA.FILE1(X).SACASA));                     0000239
D -                         YAJL_addChar                                                              0000240
D -                          ('PositiveClosure'   :%TRIMR(DATA.FILE1(X).SACASP));                     0000241
D -                         YAJL_addChar                                                              0000242
D -                          ('Closure'           :%TRIMR(DATA.FILE1(X).SACASE));                     0000243
D -                         YAJL_addChar                                                              0000244
D -                          ('RepeatEver'        :%TRIMR(DATA.FILE1(X).SACASR));                     0000245
D -                         YAJL_addChar                                                              0000246
D -                          ('RepeatMonthonMonth':%TRIMR(DATA.FILE1(X).SACASM));                     0000247
D -                         YAJL_addChar                                                              0000248
D -                          ('D/MorBoth'         :%TRIMR(DATA.FILE1(X).SACASB));                     0000249

No comments:

Post a Comment