No announcement yet.

expropts(*alwblanknum) not working?

  • Filter
  • Time
  • Show
Clear All
new posts

  • expropts(*alwblanknum) not working?

    I have this SQLRPGLE program (linear MAIN, ACTGRP(*NEW)), all PTFs up to date, with the following code:

    SNNUM = %int(S1S);
    SNNUM is packed(7).
    S1S is char(7) and is a subfield of a DS (it OVERLAYs a char screen field).

    If S1S is blanks, the assignment fails with an MCH3601.

    I have expropts(*alwblanknum) defined, I thought this was supposed to allow %int to return zero when S1S is blank, not error out.
    What am I missing?

    (I tried using %dec - same problem. I tried compiling program as RPGLE instead of SQLRPGLE, same problem).

  • #2
    My guess is that you have got the required compiler PTF but not the one for the runtime. See

    I just ran this on my 7.4 box and t runs fine as expected:
    dcl-s input char(4) inz;
    dcl-s output zoned(4);
    output = %Int(input);
    Dsply output;
    *InLr = *On;


    • #3
      I checked, all our PTFs - compiler and runtime - are up to date.

      I ran your program, as is and with some variations; it worked just fine.

      Something else is going on.


      • #4
        I'm guessing then that the field did not contain blanks but perhaps some other non-display character.

        When you find the problem please post the answer to complete the thread.


        • #5
          I checked it out in debug - it contains x'40404040404040', in other words, blanks.

          I've tried moving the field to a simple char(7) standalone field, then %int on that standalone field - in this case, it does work as expected when the standalone field is blanks.

          Still researching. It's got to be something to do when the blank field is defined as part of an external field.
          Example, S1S is defined as:
          dcl-ds M1INV;
            S1INV;  // <- This field comes from a display file.
              S1S char(7) overlay(S1INV);
              S1H char(1) overlay(S1INV: *next);
              S1O char(3) overlay(S1INV: *next);
              S1P char(7) overlay(S1INV: *next);
            S1DATE; // Just to make it zoned...
          And now I have another field in another program, field RINV#7, that is also failing when blank:
          dcl-ds R ext extname('IN3P009');
            RINV#7 char(7)   samepos(RINV#);  // RINV# (char(18)) comes from external file IN3P009
            RINV#9 zoned(18) samepos(RINV#);
            ROT9 zoned(3)    samepos(ROT);
            RPRO9 zoned(7)   samepos(RPRO);


          • #6
            MCH3601 (Pointer not set) isn't the error I would expect if *ALWBLANKNUM was not functioning. This sounds like a bug to me -- you should open a case with IBM.