ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Free Format Question

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

  • Free Format Question

    D DS
    D#PTEFFDTE 8A
    DPTEFYY 4A
    DPTEFMM 2A
    DPTEFDD 2A

    I am new to the Free Format RPG world. How do we set up a data string in free formatted RPG? In RPG 3 I used the D specs to set this up.

    Thanks,

    DAC

  • #2
    Re: Free Format Question

    dcutaia,

    You would do the same in /FREE. You just need to place the /FREE after the D specs.

    HTH,
    MdnghtPgmr
    "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

    Comment


    • #3
      Re: Free Format Question

      Hi DAC

      It could look like this, but it is up to you...

      Remember always to start at pos > 7 and end at pos 80 - It is free almost format

      Code:
      f*filename+ipeasfrlen+lklen+aidevice+.keywords+++++++++++++++++++++++++++++comments++++++++++++
      fMyFile    if   e           k disk
      
       /free
      
         Read MyFileRec;
         dow NOT %eof();
            if (a = b);
              exsr MySubr1;
            else;
               exsr mySubr2;
            endif;
            read MyFileRec;
         enddo;
         *inlr = *on;
         return;

      Bent

      Comment


      • #4
        Re: Free Format Question

        FYI: There are no "D" spec in RPG3. This is RPG4 (aka RPG-IV, RPG-ILE). The easiest way IMHO to learn free-format from RPG-IV fixed format, is to click "Convert to free-form" in the editor an watch what happens. Yeah, you might want to clean it up, but it does about 80% for you.

        Comment


        • #5
          Re: Free Format Question

          "is to click "Convert to free-form"" I must be missing that button on my screen. Do you have an extra one?

          Billw
          Bill
          "A good friend will bail you out of jail,
          A true friend would be sitting beside you saying,
          'Wow, that was fun.'"

          Comment


          • #6
            Re: Free Format Question

            Originally posted by Billw View Post
            "is to click "Convert to free-form"" I must be missing that button on my screen. Do you have an extra one?

            Billw
            If you are using WDSc and when edit RPGLE code you are able to convert blocked lines into free format

            Try it; it is a good way to start learning free format RPGLE!

            Bent

            Comment


            • #7
              Re: Free Format Question

              Originally posted by Billw View Post
              "is to click "Convert to free-form"" I must be missing that button on my screen. Do you have an extra one?

              Billw
              You are not still using SEU are you ? From the lpex editor (RSE), simply click "Source" and "Convert all to Free Form", or highlight a section of code, right-click and choose "Convert Selection to Free Form".

              Comment


              • #8
                Re: Free Format Question

                I was able to capture the allusive creature on film.
                Attached Files
                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


                • #9
                  Re: Free Format Question

                  Ya well when you're dealing with many clients in varying states of release levels/machine accessing (IE: remote access) you can't depend on using the latest development techniques. A lot of the clients restrict remote access to telnet port 23 only. Try even using iSeries Access. We have to use our box to telnet only to them or Mocha Soft.

                  Yup still using SEU. Don't even have a copy of it. Anbody got a ISO image of the CD available?

                  Billw
                  Bill
                  "A good friend will bail you out of jail,
                  A true friend would be sitting beside you saying,
                  'Wow, that was fun.'"

                  Comment


                  • #10
                    Re: Free Format Question

                    Bill - Its like 8 CD's of pure pleasure
                    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

                    Working...
                    X