IBMiAccess




Results 1 to 4 of 4

Thread: macro script in CLP?

  1. #1
    Code400 Newbie
    Join Date
    Jul 2010
    Location
    philippines
    Posts
    2
    Rep Power
    0

    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. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

  3. #2
    Noffascropulan gcraill's Avatar
    Join Date
    Mar 2006
    Location
    Hamilton
    Age
    47
    Posts
    1,549
    Rep Power
    3454

    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 !!"

  4. #3
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,417
    Rep Power
    12613

    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

  5. #4
    Code400 Newbie
    Join Date
    Jul 2010
    Location
    philippines
    Posts
    2
    Rep Power
    0

    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

  6. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Use VB macro in excel 2007 to Iseries
    By tintin in forum SQL
    Replies: 21
    Last Post: December 27th, 2010, 09:49 PM
  2. How to delete macro
    By rpgKnight in forum Iseries System administration
    Replies: 6
    Last Post: April 30th, 2009, 03:00 PM
  3. Macro/scripts/CL
    By sandman in forum CLP/CLLE
    Replies: 2
    Last Post: July 25th, 2008, 03:05 PM
  4. need SQL script
    By donna_ny in forum SQL
    Replies: 2
    Last Post: December 7th, 2006, 02:16 PM
  5. Macro To open & update a *.txt file
    By sureshpalani in forum Whatever (not programming related)
    Replies: 1
    Last Post: December 6th, 2006, 06:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •