IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

PCOMM Automation doubt


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Tue Jan 08, 2013 7:12 am
Reply with quote

Hi

This is what i'm trying to do.

I want to run a particular PCOMM macro to be run at a scheduled time.
In order to have this done, I have scheduled a Task from Windows which would open an PCOMM Session.

The problem now is i'm not able to find out how to Run the Macro script automatically once the PCOMM session is opened. Is there a way to tell the PCOMM session to start running the script automatically.

The script will take a few details from my CICS screens.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Tue Jan 08, 2013 12:02 pm
Reply with quote

Hi,

I don't have PCOMM to try this out, but here are some inputs on my acquaintance with windows scheduler.

When triggering a task or application from windows scheduler, you have the option to pass parameters(Add Arguments options) on the Actions tab. You could experiment with that,

Example: The below setting on screenshot, postimage.org/image/bykeymh7h/
the application firefox takes the argument of Use [URL] BBCode for External Links on startup. Similarly you could try passing the macro as initial argument to PCOMM.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Tue Jan 08, 2013 12:37 pm
Reply with quote

Hi, You could ignore the previous reply, it does not work in that method, just tried :S :S
probably needs more tweaking
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Tue Jan 08, 2013 1:35 pm
Reply with quote

The below method works fine :-)

1. PCOMM PATH - Find the location of the PCOMM exe path

PCSW.EXE - search for PCSW.EXE with the help of windows search, it would get you a path something like "C:\Users\Wells\PCSW.EXE" note it down.

2. SESSION PROFILE PATH - Find the location of the PCOMM profile session that you are connecting with, it is a file which has .ws extension.
In my case it is C:\Users\Wells\Desktop\Testing.ws

3. MACRO PATH - Find the location of the startup macro that you are trying to run.
In my case the macro name was mymacro.mac, So I searched it using windows search and the macro was at ""C:\Users\Wells\AppData\Roaming\IBM\Personal Communications\mymacro.mac" note this down

4. Open the macro using notepad. In our case mymacro.mac, add the below 4 lines after "REM This line calls the macro subroutine"
Code:
Dim dteWait
dteWait = DateAdd("s", 10, Now())
Do Until (Now() > dteWait)
Loop

So the macro file should look something like
Code:
.
.
.
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine

Dim dteWait
dteWait = DateAdd("s", 10, Now())
Do Until (Now() > dteWait)
Loop
.
.
.
subSub1_

This VB script introduces a 10 seconds delay so the emulator connects to host and then executes the macro.

5. Go to windows scheduler -> Go to your task -> On actions tab
Choose Start a Program
Under Program Script box give the PCOMM PATH(See point 1 above) (with quotes)
In our case "C:\Users\Wells\PCSW.EXE"

Under Add Arguments box give the SESsION PROFILE PATH(See point 2) (Without quotes) followed by macro name
In our case C:\Users\Wells\Desktop\Testing.ws /M=mymacro
postimage.org/image/448qgdy4h/


Thats it.. we are done. The macro is scheduled now. phew.

I understand these steps might be convoluted, If you have any doubts feel free to post them here.

Hope it helps.
Back to top
View user's profile Send private message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Tue Jan 08, 2013 11:43 pm
Reply with quote

Thanks for putting up such a detailed post.

I will try these options and will let you know.
The thing is you have explained the Task scheduler with Windows Vista or Higher. I use only Win XP and there is no Argument box. I guess I need to add it some where else.

Anyway i'll find that out and post out my results / Questions in case of any doubts.

Thanks again for the details. icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Thu Jan 10, 2013 12:08 am
Reply with quote

Hi,

If you are in Windows XP then you would need an additional step to create a batch file, the batch file would execute the PCOMM with arguments.

5a. open notepad and copy the below text
Code:
"C:\Users\Wells\PCSW.EXE" C:\Users\Wells\Desktop\Testing.ws   /M=mymacro
exit


It is of the format
Code:
"PCOMM PATH" SESSION_PROFILE_PATH /M=YOUR_MACRO_NAME
exit

Save the notepad file as somename.bat

5b. Go to scheduler and schedule the batch file (somename.bat) under "Start a Program"

This works wells on my one day old trial version of PCOMM from ibm site. I guess it would work on licensed versions as well.

Hope it helps.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Thu Jan 10, 2013 8:07 pm
Reply with quote

I have PCOMM version 5.8. In Edit -> Preferences -> Macro/Script...,
you can add an Auto-Start Macro/Script that will be automatically executed after PCOM is started.
Back to top
View user's profile Send private message
Vinodh S

New User


Joined: 12 Apr 2012
Posts: 28
Location: LA, California

PostPosted: Fri Jan 11, 2013 11:44 pm
Reply with quote

Thanks Vasanth. Really appreciate your help on this topic.

Marso : Thanks for posting this and letting everyone know of a simple solution to my question.

Vasanth:
I havent tried with your latest option with the BATCH file creation method. But i tried to run the PCOMM with directly giving the macro name as arguments. The PCOMM opened and it took the .WS file from the path mentioned but not the Macro. Only the work profile session loaded but the macro did not start.

It was then that i found out an option in the Preferences settings of PCOMM, exactly as what Marso had posted.
The session got connected and the macro also started. But I seem to have a problem over ther.

The macro started even before my mainframe got connected to my server. I'm thinking of adding wait statement to my macro or waiting till the cursor is avaible at the initial location after the mainframe is connected.

Not sure if you will be able to understand this post. icon_smile.gif sorry !!
Back to top
View user's profile Send private message
prema.janakkumar

New User


Joined: 29 May 2015
Posts: 1
Location: india

PostPosted: Fri May 29, 2015 2:52 am
Reply with quote

I am trying to open using the way mentioned by vasanth .. Pcomm is getting triggered but stuck (not responding) . please help

Regards,
Prema
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts A very ingenious mainframe automation... CA Products 1
No new posts doubt when executing a file when logg... TSO/ISPF 2
No new posts IBM Pcomm macro startmacro command do... IBM Tools 0
No new posts Receive a file using PCOMM macro IBM Tools 0
No new posts CA Workload Automation event code help CA Products 10
Search our Forums:

Back to Top