[go: up one dir, main page]

Menu

#48 Using Ellipses on names breaks preceding (and current) data definition

1.0
accepted
None
2025-11-06
2023-06-20
cheekychimp
No

Version 1.5.0.9

Example 1:
When an ellipses (...) is used on a named variable/structure/prototype/procedure interface that is less than "15" characters.

BEFORE
d LOAD pr extproc('APDLTXM2')
d P1 likeds(UBSID)
d P2 like(pSUB)
d APDLT_M0...
d pr

AFTER
dcl-pr LOAD extproc('APDLTXM2');
P1 likeds(UBSID);
P2 like(pSUB);
APDLT_M0
end-pr;
dcl-pr * N
end-pr;

Example 2:
When an ellipses (...) is used on a named variable/structure/prototype/procedure interface that is more than "15" characters.

BEFORE
d LOAD pr extproc('APDLTXM2')
d P1 likeds(UBSID)
d P2 like(pSUB)
d LongNameExceeding15CharsToWrite...
d s 10a inz('hello')

AFTER
dcl-pr LOAD extproc('APDLTXM2')
likeds(UBSID);
P2 like(pSUB);
end-pr;
dcl-s LongNameExceeding15CharsToWrite
Char(10) inz('hello');

Discussion

  • Ewarwoowar

    Ewarwoowar - 2023-07-23
    • status: open --> accepted
    • assigned_to: Ewarwoowar
     
  • Brian

    Brian - 2023-09-22

    As another example of this, when a prototype with an ellipsis in the name follows another prototype declaration, the name is output, then the "end-pr" is output. This is then followed by the ellipsis prototype which is output with *N as the name. Also note, comments preceding the ellipsis prototype are indented and included in the preceding prototype.

    (if you look closely, you will also notice some extra blank lines are inserted)

    For example:

          h dftactgrp(*NO)
    
          d mystring        s           5000a   varying
    
           * Comment for goodproca1
          d goodProcA1      pr            10i 0
          d   cmds                              like(mystring)
          d                                     dim(10)
    
           * Comment for goodproca2
          d goodProcA2      pr            10i 0
          d   cmd                               like(mystring)
          d                                     options(*VARSIZE)
    
           * Comment for goodproca3
          d goodProcA3      pr            10a   varying
          d
    
           * Comment for goodprocb1
          d goodProcB1      pr            10i 0
          d   cmds                              like(mystring)
          d                                     dim(10)
           * Comment for badprocb2
          d badProcB2...
          d                 pr            10i 0
          d   cmd                               like(mystring)
          d                                     options(*VARSIZE)
    
           * Comment for badprocb3
          d badProcB3...
          d                 pr            10a   varying
          d
    
           * Comment for goodprocc1
          d goodProcC1      pr             6a   varying
           *----------------------------------------------------------------
          c/FREE
            *inLR = *ON;
            return;
    

    Current (wrong) output:

    **FREE
    ctl-opt dftactgrp(*NO);
    
    dcl-s mystring           VarChar(5000);
    
    // Comment for goodproca1
    dcl-pr goodProcA1            Int(10:0);
       cmds                         like(mystring)
      dim(10);
    end-pr;
    
    // Comment for goodproca2
    dcl-pr goodProcA2            Int(10:0);
       cmd                          like(mystring)
      options(*VARSIZE);
    end-pr;
    
    // Comment for goodproca3
    dcl-pr goodProcA3        VarChar(10);
    end-pr;
    
    
    // Comment for goodprocb1
    dcl-pr goodProcB1            Int(10:0);
       cmds                         like(mystring)
      dim(10);
    
      // Comment for badprocb2
       badProcB2
    end-pr;
    dcl-pr *N                    Int(10:0);
       cmd                          like(mystring)
      options(*VARSIZE);
    
      // Comment for badprocb3
       badProcB3
    end-pr;
    dcl-pr *N                VarChar(10);
    end-pr;
    
    
    // Comment for goodprocc1
    dcl-pr goodProcC1        VarChar(6);
    end-pr;
    //----------------------------------------------------------------
    *inLR = *ON;
    return;
    

    Expected output:

    **FREE
    ctl-opt dftactgrp(*NO);
    
    dcl-s mystring           VarChar(5000);
    
    // Comment for goodproca1
    dcl-pr goodProcA1            Int(10:0);
       cmds                         like(mystring)
                                    dim(10);
    end-pr;
    
    // Comment for goodproca2
    dcl-pr goodProcA2            Int(10:0);
       cmd                          like(mystring)
                                    options(*VARSIZE);
    end-pr;
    
    // Comment for goodproca3
    dcl-pr goodProcA3        VarChar(10);
    end-pr;
    
    // Comment for goodprocb1
    dcl-pr goodProcB1            Int(10:0);
       cmds                         like(mystring)
                                    dim(10);
    end-pr;
    
    // Comment for badprocb2
    dcl-pr badProcB2             Int(10:0);
       cmd                          like(mystring)
                                    options(*VARSIZE);
    end-pr;
    
    // Comment for badprocb3
    dcl-pr badProcB3         VarChar(10);
    end-pr;
    
    // Comment for goodprocc1
    dcl-pr goodProcC1        VarChar(6);
    end-pr;
    //----------------------------------------------------------------
    *inLR = *ON;
    return;
    
     
  • Brian

    Brian - 2025-11-06

    Also, keep in mind that a definiton may span multiple lines.

    The following:

    d tkt48...
    d fld...
    d 1               s              1a
    d tkt48Ext...
    d Proc...
    d One             pr                  extproc('QsnRtvMod')
    d  modeInd                       1a   options(*OMIT: *NOPASS)
    

    Should return:

    dcl-s tkt48fld1             Char(1);
    dcl-pr tkt48ExtProcOne          extproc('QsnRtvMod');
        modeInd                 Char(1)     options(*OMIT: *NOPASS);
    end-pr;
    
     

Log in to post a comment.