PL/I

PL/I

PL/I

 View Only
  • 1.  Enterprise PL/I, alias & DB2-host-variable

    Posted Tue April 21, 2015 02:54 AM

    Dear Community,

    I tried the following:

    • define PL/I alias e.g. "define alias t_date char(10)"
    • use those types for all kind of variables and structs e.g. "dcl 1 table_foo, 2 start_date type t_date, 2 amount .... "

    Unfortunatelly the compiler gives me a "IBM3888I The reference start_date has no corresponding DB2 type" which is on the one hand understandable, on the other hand a bit harsh :-).

    Any suggestions how to deal with the situation? I know i can just remove the alias and switch back to native char(10)  but i enjoy having "domain specific aliases" for better readability etc.. 

    thanks in advance, johann

    woecki


  • 2.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Tue April 21, 2015 06:35 AM

    I don't know if and when the DB2 coprocessor will support defined types in PL/1. For pure readability, you could use pre-processor macros instead of aliases:

     

    %DCL t_date CHAR INIT('CHAR(10)');

    DCL 2 start_date t_date;

     

    The macro preprocessor runs ahead of the DB2 coprocessor so the substitution is done correctly.

    PeteKidwell


  • 3.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Wed April 22, 2015 02:04 AM

    hi pete!

    thanks for clearification.

    br johann

    woecki


  • 4.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Fri April 24, 2015 12:26 PM

    You need to provide an actual compile-able piece of code,

    not just a couple of incomplete lines.

    We need to know the context of your code.

    Robin400


  • 5.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Mon April 27, 2015 02:32 AM

    Hi Robin!

    Thanks for trying to help, but this question is already answered.
    Maybe i should have asked it in some DB2-related forum as its DB2-preprocessor related, but i missed that fact.

    br Johann 

     

    woecki


  • 6.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Mon April 27, 2015 10:07 AM

    I know.

    Suggest you keep in mind  what I wrote for future reference.

    Robin400


  • 7.  Re: Enterprise PL/I, alias & DB2-host-variable

    Posted Thu May 28, 2015 09:10 AM

    just for the records: i submitted a RFE which was accepted for future release,

    br johann

    rfe: http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=70240

    woecki