sponsored links

Collapse

Announcement

Collapse
No announcement yet.

Compile error / SQLRPGLE

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

  • #16
    Hi Barbara, still no go :/

    I get a severity 40 error if I dont have /free at the beginning.
    Moving the dcl-s (ds was a typo!) hasn't cured anything. I'm really at a loss here.

    Is there another method where I can routinely run an SQL statement in AS/400 (even using WRKJOBSCDE as a scheduled task) - that might be better.

    Code:
            *************** Beginning of data ************************************* 
    0001.00  /free                                                                  
    0002.00   dcl-s temp1 char(10) ;                                                
    0003.00   exec sql                                                              
    0004.00    SELECT stn#st INTO :temp1 FROM WARefil_ML/WARSTHD WHERE stn#st       
    0005.00   = :STEVEN;                                                            
    0006.00   *inlr = *on;                                                          
            ****************** End of data ****************************************
    Code:
         31 D  SQFRD          C                   CONST(2)                          
         32 D  SQFCRT         C                   CONST(8)                          
         33 D  SQFOVR         C                   CONST(16)                         
         34 D  SQFAPP         C                   CONST(32)                         
         35  /free                                                                  
         36   dcl-s temp1 char(10) ;                                                
     ======>     a                                                                  
     *RNF5347 30 a      000200  An assignment operator is expected with the EVAL op 
         37   exec sql                                                              
    ======>       aaa                                                              
    *RNF5347 30 a      000300  An assignment operator is expected with the EVAL op 
        38    SELECT stn#st INTO :temp1 FROM WARefil_ML/WARSTHD WHERE stn#st       
        39   = :STEVEN;                                                            
        40   *inlr = *on;                                                          
           * * * * *   E N D   O F   S O U R C E   * * * * *                       
     5722WDS V5R2M0  020719 RN        IBM ILE RPG             DWMS000/SQLV4        
              A d d i t i o n a l   D i a g n o s t i c   M e s s a g e s          
     Msg id  Sv Number Seq     Message text                                        
    *RNF7030 30     36 000200  The name or indicator DCL is not defined.           
    *RNF7030 30     37 000300  The name or indicator EXEC is not defined.          
    *RNF7030 30     37 000300  The name or indicator SQL is not defined.           
     * * * * *   E N D   O F   A D D I T I O N A L   D I A G N O S T I C   M E S S 
     5722WDS V5R2M0  020719 RN        IBM ILE RPG             DWMS000/SQLV4        
                              C r o s s   R e f e r e n c e                        
          File and Record References:

    Comment


    • #17
      Barbara - you are assuming the OP is using an OS version that supports the free-form D specs.
      Looking at the bottom of the compiler listing, I see:
      Code:
      5722WDS V5R2M0  020719 RN        IBM ILE RPG             DWMS000/SQLV4
      So, it looks like the OP is on OS version 5.2 and as such the free-form D specs are not available. I don't recall what OS version free-form RPG was introduced so not sure if that's even available.

      Comment


      • #18
        PureBluff - remove the DCL-S and place it back into the D specs:

        Code:
        D  temp1          S             10a
        I can't help with the SQL part as I'm not familiar with the syntax requirements under V5R2. Hopefully someone else can assist with that.

        Comment


        • #19
          Finally! I managed to compile it using the below;

          Code:
           FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++ 
                  *************** Beginning of data ************************************* 
          0001.00 D  temp1          S             10a                                     
          0002.00 C                   SETON                                        LR     
          0003.00                                                                         
          0004.00 c/exec sql                                                              
          0005.00 c+ SELECT stn#st INTO :temp1                                            
          0006.00 c+ FROM WARefil_ML/WARSTHD                                              
          0007.00 c+ WHERE stn#st = 'STEVEN'                                              
          0008.00 c/end-exec                                                              
                  ****************** End of data ****************************************
          Thanks to everyone that input. I can now begin to progress things. Although the game changed yesterday when the consultant advised of a way to do things that completely threw a spanner in the works,

          Comment


          • #20
            As an FYI, you can use the extended factor 2 for your c-specs. Enter IPCX in the line number column to prompt the syntax. The SETON LR command could be written as:
            Code:
            C                   EVAL      *INLR = *ON
            Not a big deal for that as SETON LR is pretty self explanatory but it can make code a little nicer to read.

            Comment


            • #21
              Originally posted by john.sev99 View Post
              Barbara - you are assuming the OP is using an OS version that supports the free-form D specs.
              Oops! I forgot the first rule: Never make assumptions.

              Comment


              • #22
                Now they're wanting to help us develop it.....

                /sigh

                Comment

                sponsored links

                Collapse

                Working...
                X