ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL0312 during Fetch when using D-spec defined DS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL0312 during Fetch when using D-spec defined DS

    While working to convert an SQLRPGLE program I wrotein all free into mixed format I tried to compile the program but received an SQL0312 on the lines where I FETCH data into a DS.

    Here's the d-spec version
    Code:
    D extractDS            DS                          qualified
    D    shortname                         18a
    D    brchcode                           5s 0
    D    refnum                            12s 0
    D    prodcode                           5s 0
    D    proddsc                           30a
    D    curcode                            3p 0
    D    curdsc                             3a
    D    date1                              9p 0
    D    date2                              9p 0
    D    amt1                              17p 2
    D    amt2                              17p 2
    D    tsum                              21p 5
    D    convamt                           17p 2
    D    storename                         40a
    and the allfree version
    Code:
    dcl-ds extractds qualified;
      shortname  char(18);
       brchcode    zoned(5:0);
       refnum        zoned(12:0);
       prodcod      zoned(5:0);
       proddsc      char(30);
       curcode      packed(3:0);
       curdsc        char(3);
       date1          packed(9:0) ;
       date2          packed(9:0);
        amt1          packed(17:2);
        amt2          packed(17:2);
       tsum           packed(21:5);
       convamt     packed(17:2);
        storename char(40);
    end-ds
    The all free version compiles fine but when I try to compile the d-spec version the precompiler says extractds is undefined or unusable. Can anyone spot if I missed anything during the conversion?

    Sorry about the spacing. I am posting this from my phone
    Last edited by JustinWithoutAnE; April 26, 2018, 11:54 PM.

  • #2
    If you are writing in fixed format, the D-Specs are fixed, i.e. all length, data type and decimal position specifications must be on the same position!
    Just prompt your D-Specs!

    Birgitta

    Comment


    • #3
      The code is all lined up in the program. I used the d-spec prompt to populate it but the precompiler still can't recognize it. I forget but d-specs DS ends when a standalone field is found right? No endds?



      I find it a bit hard to format the contents of the code tag here using my phone.

      Comment


      • #4
        Finally found what I was doing wrong: Mixed format only allows 80 columns while I originally had some lines upto column 90 in all free.

        Comment

        Working...
        X