Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

REXX & SQL - FRUSTRATED!

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

  • REXX & SQL - FRUSTRATED!

    Did you remember your ADDRESS EXECSQL instruction before the EXECSQL instruction, or, use the CMDENV(*EXECSQL) parameter in the STRREXPRC command?

  • #2
    REXX & SQL - FRUSTRATED!

    Since I am learning REXX the (Hard Way, which is by myself), I do not understand the address EXECSQL statement. Could you please explain it to me. I did go back and look in the example, and it has the following lines before the UPDATE. Is this what you mean? /*Create the output file to dump the 2 reports.Perform an OVRDBF */ 26 /*to allow us to use the SAY REXX command to write to the output */ 27 /*file.*/ 28 ADDRESS '*COMMAND', 29 'DLTF FILE(CORPDATA/REPORTFILE)' 30 ADDRESS '*COMMAND', 31 'CRTPF FILE(CORPDATA/REPORTFILE)RCDLEN(80)' 32 ADDRESS '*COMMAND', 33 'OVRDBF FILE(STDOUT)TOFILE(CORPDATA/REPORTFILE)MBR(REPORTFILE)'

    Comment


    • #3
      REXX & SQL - FRUSTRATED!

      Figure 8. Sample REXX Procedure Using SQL Statements (Part 1 of 3) 160 DB2 UDB for iSeries SQL Programming with Host Languages V5R1

      Comment


      • #4
        REXX & SQL - FRUSTRATED!

        Dear Gene, Thanks for your assistance. It is much appreciated.!

        Comment


        • #5
          REXX & SQL - FRUSTRATED!

          To whom it may concern: I have looked and spent hours on how to automate a SQL with REXX. To my surprise, the only word I have it YUCK! I have a database file that I need to do a mass update on. So, I went to the IBM SQL Manuals and looked at an example of REXX & SQL. I tried it. Of course, it did not work. Please help. Just so you will know, the first & second dates will be the same number. For example, 1011212 is Dec 12 ,2001. The third will be 0121301 is December 13 2001. The example is below. My code is below. Thanks in advance. Out of book. 39 UPDATE_STMT ='UPDATE CORPDATA/EMPLOYEE ', 40 'SET SALARY =SALARY *?', 41 'WHERE COMM >=?' 42 EXECSQL, 43 'PREPARE S1 FROM :UPDATE_STMT' 44 EXECSQL, 45 'EXECUTE S1 USING :PERCENTAGE,', 46 ':COMMISSION My code RC = 0 Say "Enter the First date" pull first Say "Enter the second date" pull second Say "Enter the third date" pull third UPDSTM = 'UPDATE AKFILES3/AKWKP100 ', 'SET WKTRDR = ? ' , 'Set WKDTAD = ? ' , 'WHERE WKDTAD = ? ' EXECSQL , 'PREPARE S1 FROM :UPDSTM' EXECSQL, 'EXECUTE S1 using :first, ', ' :second ', ' :third'

          Comment


          • #6
            REXX & SQL - FRUSTRATED!

            You might try to get a copy of Charles Daney's book and also the book by Anthony S. RUDD. Also, there's good stuff at www2.hursley.ibm.com w/ several tutorials. REXX/400 is a little crippled compared to MVS and PC versions but you are on the right track. bobh

            Comment

            Working...
            X