ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Char to ASCII

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

  • #16
    Re: Char to ASCII

    Originally posted by MichaelCatalani View Post
    A binding directory contains a list of service programs / modules. Instead of listing each service program / module on the compile command, you can simply list the binding directory.

    An even better approach is to specify the binding directory on the control specification in your application. That way neither you, nor anyone else that changes the application behind you, will need to specify any compiler commands that have to do with modules, service programs, or binding directories. All of the modules and service programs will be located and bound to automatically by the compiler by searching the binding directory(s).



    yes, but not as easily as specifying a binding directory on the control spec.

    For example:

    h BndDir( 'CF' ) dftactgrp(*no)

    With this control spec in the application, I am telling the compiler that any export I need is located in a servce program or module located in the CF binding directory. I dont need to list anything on the compile command. Even if an application needs to bind to 300 procedures located in 40 service programs or modules, I dont have to list anything on the compile command as long as those service programs or modules are located inside the binding directory I reference on the control spec. ( you can specify multiple binding directories as well.)

    Binding directories GREATLY simply compiling of programs that bind to many modules or service programs. If I needed to make a quick change to an application that did, I could spend some time on simply keying in the module / service program parameters on the compile command. Even worse, I may have to RESEARCH each procedure to see what module / service program they were located in if the application did not have this documented. By using a binding directory on the control spec, I'm telling the compiler that anything it needs to bind to will be in a module or service program thats listed in the binding directory; and that the compiler can go find them itself and bind to them without anything else needed from me. So that allows me to make a quick change, and a blind compile with no parameters needed.

    The last thing I want to have to do when making a quick 30 second change is to spend 2 hours researching where all of the exports are located, and getting the parameters on my compile command correct so that everything can bind correctly.
    hi Michael Catalani,
    thx u for your reply... after i read ur reply binding directory more simply than CRTPGM.
    could give a small example program that using CRTPGM ???

    thx u

    Comment


    • #17
      Re: Char to ASCII

      Originally posted by rx_b10 View Post
      thx u tomholden i understand now

      if i add a new procedure in XLATE_S say it procedure XLATE_A.

      so i need to add

      PHP Code:
                   STRPGMEXP  PGMLVL(*CURRENT)
                   
      EXPORT     SYMBOL(XLATE_EBCDICTOASCII)
                   
      EXPORT     SYMBOL(XLATE_TOHEX)
                   
      EXPORT     SYMBOL(XLATE_HEXTODECIMAL)
      [
      B]             EXPORT     SYMBOL(XLATE_A) [/B]
                   
      ENDPGMEXP 
      when bnd source have change, so just recompile a service program only? is it right ????

      thx u
      correct. i have a powerpoint on service programs on my web site that might help you out it's in the downloads section http://tommyholden.com
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #18
        Re: Char to ASCII

        Originally posted by rx_b10 View Post
        could give a small example program that using CRTPGM ???

        thx u
        To give you an example, as well as demonstrate the point about the benefits of using a binding directory, remove the "H" control spec in the CharToDec program above.

        Then you'lll need to create a module, then the program. (I'm assuming the source and module will be located in a library called "EXAMPLE")

        CRTRPGMOD MODULE(EXAMPLE/CHARTODEC) SRCFILE(EXAMPLE/QRPGLESRC)

        Then you can use the CRTPGM command to create the program from the module.

        CRTPGM PGM(EXAMPLE/CHARTODEC) BNDSRVPGM((XLATE_S)) ACTGRP(*CALLER)


        Notice by not using a binding directory, I have to tell the CRTPGM command every service program this application needs to bind to.
        This also means that I would likely need to research the application and service programs to find out which ones the appliacion needs unless they are documented in the application source. Even if they are documented, I still have to key all of them in on the CRTPGM command.

        OR

        I could leave the control spec in place, which specifies the BNDDIR keyword. This tells the binding step which binding directories to search in order to locate the service programs needed. By doing this, I only need to execute the CRTBNDRPG command to perform both the compiling and binding in one step. (ie: use option 14 from PDM or click CRTBNDRPG from rdI) I dont need specify any other parameters.


        CRTBNDRPG PGM(EXAMPLE/CHARTODEC) SRCFILE(EXAMPLE/QRPGLESRC)
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #19
          Re: Char to ASCII

          Originally posted by MichaelCatalani View Post
          To give you an example, as well as demonstrate the point about the benefits of using a binding directory, remove the "H" control spec in the CharToDec program above.

          Then you'lll need to create a module, then the program. (I'm assuming the source and module will be located in a library called "EXAMPLE")

          CRTRPGMOD MODULE(EXAMPLE/CHARTODEC) SRCFILE(EXAMPLE/QRPGLESRC)

          Then you can use the CRTPGM command to create the program from the module.

          CRTPGM PGM(EXAMPLE/CHARTODEC) BNDSRVPGM((XLATE_S)) ACTGRP(*CALLER)


          Notice by not using a binding directory, I have to tell the CRTPGM command every service program this application needs to bind to.
          This also means that I would likely need to research the application and service programs to find out which ones the appliacion needs unless they are documented in the application source. Even if they are documented, I still have to key all of them in on the CRTPGM command.

          OR

          I could leave the control spec in place, which specifies the BNDDIR keyword. This tells the binding step which binding directories to search in order to locate the service programs needed. By doing this, I only need to execute the CRTBNDRPG command to perform both the compiling and binding in one step. (ie: use option 14 from PDM or click CRTBNDRPG from rdI) I dont need specify any other parameters.


          CRTBNDRPG PGM(EXAMPLE/CHARTODEC) SRCFILE(EXAMPLE/QRPGLESRC)
          thx for reply michael,
          i juast want to know more about CRTPGM

          CRTPGM can consist of many module,

          CRTPGM PGM(LIB1/PGM1) MODULE(MODULE1 MODULE2)

          could give me an simply example source program to compile like it? and how to call it in RPGLE ???


          thx u very much michael

          Comment

          Working...
          X