ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Data Area

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

  • #16
    Re: Data Area

    It wasnt that much work ... I just hobbled it together from other programs.

    You are not updating your dataarea in your example
    you do need the OUT opcode for this.

    unless there is a UDS ........... somewhere up in your d specs

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #17
      Re: Data Area

      Nope, no UDS anywhere. You don't need to OUT anything. Just put CLEAR in the opcode and the name of your dataarea in the Result field. Leave Factor 2 blank.

      It works like a charm for me.
      Your future President
      Bryce

      ---------------------------------------------
      http://www.bravobryce.com

      Comment


      • #18
        Re: Data Area

        You mean your just clearing the dataarea field within your program?

        not the actual dataarea Right?
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #19
          Re: Data Area

          RIGHT.....just in my program.
          Your future President
          Bryce

          ---------------------------------------------
          http://www.bravobryce.com

          Comment


          • #20
            Re: Data Area

            Ok....so sometimes when you fix one bug you introduce another one.....and I am now guilty of this....I cleared my data area but now that little tip you gave me about the Opposite indicator thing stopped working and I can't understand why.

            UPDATE: I was just doing some testing, and it doesn't matter if I've cleared the data area yet or not, just putting that in there has done it....maybe I changed something else that I'm not aware of.....I'll keep testing...
            Your future President
            Bryce

            ---------------------------------------------
            http://www.bravobryce.com

            Comment


            • #21
              Re: Data Area

              I flipped switched which indicator is the negative indicator and now it works...strange...but it works....
              Your future President
              Bryce

              ---------------------------------------------
              http://www.bravobryce.com

              Comment


              • #22
                Re: Data Area

                Ok, not to complicate things....but anyone know if a dtaara value can be read from sql within a clp? - JT

                Comment


                • #23
                  Re: Data Area

                  Hi JT:

                  You can use qmqry


                  Code:
                  pgm                                                
                               DCL        VAR(&FRYMD) TYPE(*char) LEN(6)            
                               DCL        VAR(&TOYMD) TYPE(*char) LEN(6)            
                           CHGVAR &FRYMD VALUE(%SST(*LDA,1,6))
                           CHGVAR &TOYMD VALUE(%SST(*LDA,7,6))                                                
                               CHKOBJ     OBJ(QTEMP/PXDEDEXTA) OBJTYPE(*FILE)       
                               MONMSG     MSGID(CPF9800) EXEC(DO)                   
                               STRQMQRY   QMQRY(MYLIB/PXDEDWKQM) OUTPUT(*OUTFILE) 
                                            OUTFILE(QTEMP/PXDEDEXTA) NAMING(*SQL) + 
                                            SETVAR(('FRDT' &FRYMD) ('TODT' &TOYMD)) 
                                            enddo   
                                     endpgm
                  Code:
                          SELECT                                                             
                   -- Columns                                                         
                         A.DACCT, (A.TRXDTY * 10000) + (A.TRXDTM * 100) + A.TRXDTD AS 
                   TRXDATE, SUM(A.DDAMT) AS TOTDED, SUM(A.DSVCG) AS TOTSC             
                   -- Tables                                                          
                         FROM MYLIB.PXDED A                                           
                   -- Row Selection                                                   
                         WHERE (((A.TRXDTY * 10000) + (A.TRXDTM * 100) + (A.TRXDTD))  
                               BETWEEN &FRDT AND  &TODT)                              
                         and DSOURC <> 'B'                                            
                         GROUP BY A.TRXDTY, A.TRXDTM, A.TRXDTD, A.DACCT               
                         ORDER BY A.TRXDTY,  A.TRXDTM, A.TRXDTD, A.DACCT

                  Best of Luck
                  GLS
                  The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                  Comment


                  • #24
                    Re: Data Area

                    The short answer is no but not sure to clearly understand the question.
                    Philippe

                    Comment


                    • #25
                      Re: Data Area

                      Originally posted by JT400coder View Post
                      ...value can be read from sql within a clp?
                      It depends on what you mean by that.
                      "Time passes, but sometimes it beats the <crap> out of you as it goes."

                      Comment


                      • #26
                        Re: Data Area

                        Thanks to all....I will try it...my apologies for not responding more quickly...need to update my email...it's been changed @work.

                        - JT

                        Comment


                        • #27
                          Re: Data Area

                          You can also force a read of the UDS (IN) and an update (OUT) of the UDS within the program, however it also does read same at the front and outputs same at the end of the program without the IN and OUT statements. The company I am doing some work for uses the LDA throughout it's programs and passes LDA values from one program to the next and back on calls within the programs.

                          Comment

                          Working...
                          X