ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Conversion

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

  • Conversion

    Can this be converted to Free? If so, what's the easiest way?
    (all @ fields are numeric (P=period, W=week)
    Code:
         C     HAWeek        ADD       3             @P
         C     @P            DIV       4             @P
         C                   MVR                     @W
         C                   ADD       1             @W
    thanks for the help!

  • #2
    Re: Conversion

    Im in class have 2 pay attention look @ %div and %rem bigguy!!!
    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


    • #3
      Re: Conversion

      Hi,

      try the following:


      /Free
      @W = %Rem(%Int(HAWeek + 3): 4) + 1;
      /End-Free
      Birgitta

      Comment


      • #4
        Re: Conversion

        I like that B... looks clean!

        Thanks!!

        Comment


        • #5
          Re: Conversion

          But...

          I need both numbers (@P and @W) ... so, what about

          @P = %Int( HAWeek + 3 ) / 4;
          @W = %Rem( %Int( HAWeek + 3 ) : 4 ) + 1;

          Yes? No? Maybe?

          Comment


          • #6
            Re: Conversion

            Hi,

            I'd change it as follows:

            @P = %Div(%Int( HAWeek + 3 ): 4);
            or
            @P = %Int(%Int(HAWeek + 3) / 4);
            Birgitta

            Comment


            • #7
              Re: Conversion

              The easiest way IMHO to learn free - open your program using lpex editor. Click on "convert to free-form", and the entire C-specs (or a selection) gets converted instantly to freeform. OK, you can rewrite to improve on the converted specs, but it does a decent job. Also has a built in reference guide that shows commands / BIFs / freeform versions. If you are keying in a BIF, pressing Ctry-Space prompts for the next parm.

              Comment


              • #8
                Re: Conversion

                Originally posted by arrow483
                The easiest way IMHO to learn free - open your program using lpex editor. Click on "convert to free-form", and the entire C-specs (or a selection) gets converted instantly to freeform. OK, you can rewrite to improve on the converted specs, but it does a decent job. Also has a built in reference guide that shows commands / BIFs / freeform versions. If you are keying in a BIF, pressing Ctry-Space prompts for the next parm.

                not aware of this LPEX editor...is this something that comes default with iseries?
                i am on 520 and would be curious to see if i can use this editor or not..

                thanks for any help

                Comment


                • #9
                  Re: Conversion

                  The LPEX editor is part of WDSc. This comes as a seperate set of CD's and is shipped at no charge with the operating system if you purchase any of the WDS compilers (such as RPG, COBOL, BASIC, etc).

                  WSDc installs on the PC, and can edit files on the PC or any AS400. The LPEX editor edits RPG, COBOL, DDS, JAVA, XML, HTML, others.

                  Ask your system operator to look for a set of CD's marked "Websphere Development Studio Client". They are usually in a "book" of CD's.

                  Comment


                  • #10
                    Re: Conversion

                    darn it.. thats what i am missing....i dont have WDSC in my computer...
                    thanks for the light

                    Comment

                    Working...
                    X