ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Sample records file

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

  • #16
    Re: Sample records file

    A stored procedure is shipped as part of the system that contains the DDL statements to create DB2 Universal Database? for iSeries sample tables, and the INSERT statements to populate them. The procedure will create the schema specified on the call to the procedure. Since this is an SQL external stored procedure, it can be called from any SQL interface, including interactive SQL and iSeries? Navigator. To call the procedure where SAMPLE is the schema you want to create, issue the following statement:
    Code:
    CALL QSYS.CREATE_SQL_SAMPLE ('SAMPLE')
    The schema name must be specified in uppercase. The schema must not already exist.
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #17
      Re: Sample records file

      So I compiled a physical file containing the following:
      Code:
           A          R CUREC                    TEXT('CUSTOMER FILE')   
           A            CUCO           3S 0      TEXT('COMPANY #')       
           A            CUSTS          1A        TEXT('STATUS CODE')     
           A            CUNUM          5S 0      TEXT('CUSTOMER #')      
           A            CUNAME        30A        TEXT('CUSTOMER NAME')   
           A            CUADR         30A        TEXT('CUSTOMER ADDRESS')
           A            CUCITY        18A        TEXT('CUSTOMER CITY')   
           A            CUSTAT         2A        TEXT('CUSTOMER STATE')  
           A            CUZIP          9S 0      TEXT('CUSTOMER ZIP')        
           A            CUCRLM         9P 2      TEXT('CUST CREDIT LIMIT')
      I am not sure how to now enter a few records.

      Comment


      • #18
        Re: Sample records file

        If you have DFU, you can do: UPDDTA MYLIB/MYFILE

        Or, you can insert them with SQL:

        Code:
        insert mylib/myfile values(123, 'A', 12345, 'Acme Widgets, Inc', '123 Sesame St', 'New York', 'NY', 123450000, 9999999.99)
        Or use other software... iNav, WRKDBF, DBU... whatever you have...

        Comment


        • #19
          Re: Sample records file

          Hi Raywes88:

          This might be easier if you had a Keyed File. See red line below:

          Code:
               a          r curec                    text('customer file')   
               a            cuco           3s 0      text('company #')       
               a            custs          1a        text('status code')     
               a            cunum          5s 0      text('customer #')      
               a            cuname        30a        text('customer name')   
               a            cuadr         30a        text('customer address')
               a            cucity        18a        text('customer city')   
               a            custat         2a        text('customer state')  
               a            cuzip          9s 0      text('customer zip')        
               a            cucrlm         9p 2      text('cust credit limit') 
              [COLOR=#ff0000] a          k CUNUM [/COLOR]
          You may have multiple fields as keys....Just duplicate the "K" and next field name on a new line

          In DFU use f10-entry mode/f11-change mode/F23 (twice) delete the record

          DFU will allow you to retrieve the record for update by customer number (cunum) instead of record number

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

          Comment


          • #20
            Re: Sample records file

            I figured I should mention that I got the job . Also thanks to you guys for pointing me in the right direction. I have managed to write a simple report program based on the customer physical file above and an interactive program that displays records of a physical file with two keys containing records about fake college classes. I am much more confident going into this now having done some things on my own.

            Comment


            • #21
              Re: Sample records file

              congrats!!!
              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


              • #22
                Re: Sample records file

                Originally posted by Raywes88 View Post
                I figured I should mention that I got the job . Also thanks to you guys for pointing me in the right direction. I have managed to write a simple report program based on the customer physical file above and an interactive program that displays records of a physical file with two keys containing records about fake college classes. I am much more confident going into this now having done some things on my own.
                Congrats on the new job! It's always great to see someone take initiative and put this amount of effort into attempting to land and/or prepare themselves for a new position.
                Michael Catalani
                IS Director, eCommerce & Web Development
                Acceptance Insurance Corporation
                www.AcceptanceInsurance.com
                www.ProvatoSys.com

                Comment


                • #23
                  Re: Sample records file

                  Congrats!!

                  Comment


                  • #24
                    Re: Sample records file

                    Good luck!!
                    Regards

                    Kit
                    http://www.ecofitonline.com
                    DeskfIT - ChangefIT - XrefIT
                    ___________________________________
                    There are only 3 kinds of people -
                    Those that can count and those that can't.

                    Comment


                    • #25
                      Re: Sample records file

                      Nice work young man!
                      Greg Craill: "Life's hard - Get a helmet !!"

                      Comment


                      • #26
                        Re: Sample records file

                        Not to necro a thread or anything, but, I figured I'd mention that I am doing well in the position and they have even let me start my own project to develop some PC based applications in my area of expertise (Java, python, etc. The IBM toolbox for java is fantastic). At this point for me it is just learning more about the server that is ongoing, I feel I have a good grasp on RPGLE and it's predecessors. Thanks again for holding my hand through creating a physical file haha.

                        Comment


                        • #27
                          Re: Sample records file

                          Cool!

                          Comment


                          • #28
                            Re: Sample records file

                            *like*
                            Regards

                            Kit
                            http://www.ecofitonline.com
                            DeskfIT - ChangefIT - XrefIT
                            ___________________________________
                            There are only 3 kinds of people -
                            Those that can count and those that can't.

                            Comment


                            • #29
                              It's me again

                              I'm 31 years old now and my daughter is 12 weeks old as of Monday. Last year the textile mill that offered me this job closed due to market contractions a la COVID-19.

                              I found a new position at a local business as an SE working on things like integrating modern Android barcode scanners into client's old TE systems etc. I recovered my account here today because, of all things, this company also does some software development, and lo, an RPG opportunity was mentioned at the meeting this morning and they were all shocked to learn that I am pretty handy with it haha. Life is strange sometimes.

                              Just thought I'd share. I hope you're all doing well.
                              - Wes

                              Comment

                              Working...
                              X