Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PCOMM Automation doubt

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

New User


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

PostPosted: Tue Jan 08, 2013 7:12 am    Post subject: PCOMM Automation doubt
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: 1445
Location: Azeroth

PostPosted: Tue Jan 08, 2013 12:02 pm    Post subject:
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, http://postimage.org/image/bykeymh7h/
the application firefox takes the argument of www.google.com 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: 1445
Location: Azeroth

PostPosted: Tue Jan 08, 2013 12:37 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Tue Jan 08, 2013 1:35 pm    Post subject:
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
http://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: 30
Location: LA, California

PostPosted: Tue Jan 08, 2013 11:43 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Thu Jan 10, 2013 12:08 am    Post subject:
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: 1219
Location: Israel

PostPosted: Thu Jan 10, 2013 8:07 pm    Post subject: Reply to: PCOMM Automation doubt
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: 30
Location: LA, California

PostPosted: Fri Jan 11, 2013 11:44 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Automation of data entry using Rexx i... zingy.rajeev CLIST & REXX 4 Mon Aug 22, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Automation of data entry using Rexx i... zingy.rajeev CICS 0 Mon Aug 22, 2016 4:11 pm
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm
No new posts Automation in DB2 chhabraravneet DB2 4 Fri Dec 11, 2015 9:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us