ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to retrieve system date from display file to rpg program

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

  • How to retrieve system date from display file to rpg program

    I have a display file that is defined as decimal date.I want it to fetch the system date and be used a variable in my rpg program.

    I have defined a PF that has a date variable 6 length 0 decimal PACKED.I am aware that by using *DATE in display file we can fetch system date.But i want to refrain using that format since i would further like to perform operations like calculating Period etc by using this variable.

    Please guide how can i go about flashing a system date on display and further having that variable available in my RPG program.

    Thanks in advance

  • #2
    Re: How to retrieve system date from display file to rpg program



    Testing / converting dates
    I'm here to chew bubble gum and kick @#%@#%@#%.....and I'm all outta bubble gum !
    Yes I'm talking to you squirrel nuts.

    Comment


    • #3
      Re: How to retrieve system date from display file to rpg program

      Thanks for replying.But how can i have the display file fetch the system date automatically?

      Comment


      • #4
        Re: How to retrieve system date from display file to rpg program

        you cant...
        you need to write RPG code & make display field type 9 (both input & output)
        I'm here to chew bubble gum and kick @#%@#%@#%.....and I'm all outta bubble gum !
        Yes I'm talking to you squirrel nuts.

        Comment


        • #5
          Re: How to retrieve system date from display file to rpg program

          Is there no other way in which i can rid the user from having to enter the date manually or by which i can capture the system date and thereby allow its value to be referenced in my rpg program too?

          Comment


          • #6
            Re: How to retrieve system date from display file to rpg program

            What do you want?
            You want to predefine an input/outupt field with the system date, so the user can either change it or accept it?
            In this way you need to retrieve the system date in your RPG program and move it into the input/output field before sending out the screen (i.e. before executing the EXTFMT command.

            ... and why bother do you try to write RPGIII programs. RPGIII is outdated and was not changed or enhanced anymore the last 20 years.
            Learn RPGIV the successor of RPGIII with Free Format Coding and ILE concepts.

            ... and forgot about numeric dates use real date and time values! Which easily can be done with RPGIV, but not with RPGIII!

            Birgitta

            Comment


            • #7
              Re: How to retrieve system date from display file to rpg program

              Hi Birgitta

              Me being a newbie on this platform, have been alloted rpg 3 specific project hence i have no option but to live with it.
              What i actually want is:
              In Physical file:There is a Date member of 6P 0
              In Display File,i have referenced this value as Output
              In RPGIII: I would like to somehow flash the current system time over that display field value
              Similarly once other fields of that display file have been entered and submitted,all of this information along with the date must be saved in the PF
              Plus this date is taken as decimal coz i would like to later perform calculation of Period value.Hence this date must exist as *EUR format on display screen and be saved as *ISO format in database.Would much appreciate ur help.

              Comment


              • #8
                Re: How to retrieve system date from display file to rpg program

                you have to do as we are trying to tell you...

                on the DDS (screen) make the field 9 (both input & output)

                in the RPG get system date convert to USA and populate the screen field in the RPG prior to the exfmt of the screen

                read this:


                No one on this site wants to write your code...You have to.
                I'm here to chew bubble gum and kick @#%@#%@#%.....and I'm all outta bubble gum !
                Yes I'm talking to you squirrel nuts.

                Comment


                • #9
                  Re: How to retrieve system date from display file to rpg program

                  #MyUsualRantAboutRPGIII
                  .....ug tell your fosil of a boss NO to using that ugly crap.
                  #EndRant
                  Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

                  Comment


                  • #10
                    Re: How to retrieve system date from display file to rpg program

                    If your boss insists on using RPGIII, then use the CVTRPGSRC command to convert the source to RPG 3.1. Then you will be able to use all of the new fancy date stuff.
                    Michael Catalani
                    IS Director, eCommerce & Web Development
                    Acceptance Insurance Corporation
                    www.AcceptanceInsurance.com
                    www.ProvatoSys.com

                    Comment


                    • #11
                      Re: How to retrieve system date from display file to rpg program

                      Originally posted by techas400 View Post
                      have been alloted rpg 3 specific project hence i have no option but to live with it.
                      Boy do i feel that pain... I inherited RPGII, III and IV with this shop. Imagine my shock when I found a program using matching records. I actually had to break out the text books and remind myself how they worked.

                      Comment

                      Working...
                      X