sponsored links

Collapse

Announcement

Collapse
No announcement yet.

macro script in CLP?

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

  • macro script in CLP?

    hi! I'm new here guys... I just wanna know if its possible to insert a macro script in a clp program that i could call as a program? can i have a simple sample? or there's a better way? thnks u so much....

    PGM
    'macro script
    ENDPGM

  • #2
    Re: macro script in CLP?

    Ummm a CLP is sorta like a script, why not put the script code in um like the CLP you know ?

    Otherwise this looks a bit tedious ...

    Pgm
    Call OtherPgm
    EndPgm
    Greg Craill: "Life's hard - Get a helmet !!"

    Comment


    • #3
      Re: macro script in CLP?

      post your script file.....please
      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


      • #4
        Re: macro script in CLP?

        this is my macro script run in play/run script in the toolbar of as400

        [PCOMM SCRIPT HEADER]
        LANGUAGE=VBSCRIPT
        DESCRIPTION= using option MAB
        [PCOMM SCRIPT SOURCE]
        OPTION EXPLICIT
        autECLSession.SetConnectionByName(ThisSessionName)

        dim bnum
        dim actnum
        dim actsfx
        dim nname
        dim oname
        dim ans

        REM This line calls the macro subroutine
        subSub1_

        sub subSub1_()
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "wmenu1"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "cba"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "mab"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[down]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[down]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[down]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "y"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[pf3]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "mab"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"

        bnum= inputbox("Enter branch number:", "BRANCH cODE NUMBER", "0001")
        actnum= inputbox("Enter Account number:", "ACCOUNT NUMBER", "000001")
        actsfx= inputbox("Enter Account suffix:", "ACCOUNT SUFFIX", "201")
        nname= inputbox("Enter New Short name:", "ACCOUNT NUMBER")


        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys bnum
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys actnum
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys actsfx
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[pf5]"

        oname = autECLSession.autECLPS.gettext(11,29,15)
        ans= msgbox ("Do you want to change this " & oname & " to " & nname & " ", vbyesno , "Confirmation")
        if ans=vbyes then
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[erase eof]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys nname
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLPS.Wait 3000
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        autECLSession.autECLOIA.WaitForInputReady
        autECLSession.autECLPS.SendKeys "[enter]"
        end if
        end sub



        i just wanna know if this is possible to convert or just run as a code in a clp? sorry im new with this... tnx for the help

        Comment

        sponsored links

        Collapse

        Working...
        X