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

PCOMM macro to call another PCOMM macro


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

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Tue Jul 12, 2016 4:30 pm
Reply with quote

Hi,

I'm trying to call a PCOMM macro inside another PCOMM macro. But having this error: Variable is undefined: 'test_macro'.
Both macros are in the same folder.
Please help me to point out on how to do it correctly.

This is the macro I used to call another macro.
The "test_macro" is another macro which is working normal on its own.
Code:

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

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
   call test_macro
end sub


This is what I found in the manual.

Call Statement
Description - Transfers control to another macro file. When the Exit command in the second macro file is encountered, execution returns to the command that follows Call statement Up to 10 levels of macro files can be called
Syntax : Call MacroFilename

I'm using Quick3270™ Macro Language Reference Manual Version 4.52 as a reference.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 12, 2016 6:18 pm
Reply with quote

So "test_macro" is stored in the directory without any extension? If it has an extension, you need to either remove the extension so the call can find the macro file, or add the extension to the call statement filename.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Wed Jul 13, 2016 7:30 am
Reply with quote

Hi Robert,

Thanks for your reply.

I have followed your advice. Initially, both macro have the extension of .mac

I tried removing the extension of test_macro in the directory then run the same macro I posted above.

Then I also tried putting the .mac extension in both of the file and inside the macro.

Both still resulted in the same error of - Variable is undefined: 'test_macro'.

Would I be needing to declare something?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Jul 13, 2016 9:46 pm
Reply with quote

Quote:
I'm using Quick3270™ Macro Language Reference Manual Version 4.52 as a reference.


Can you clarify the environment?

What I gleaned from that manual: PCOMM macros will work in the Quick3270 emulator.

But I doubt there is a similar statement that Quick3270 macros will run in the PCOMM emulator. You should refer to the PCOMM manual.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Jul 14, 2016 3:26 pm
Reply with quote

Hi Pedro,

First of all, let me thank you. Recently, I have read your 'Share in Orlando' and help me lot in my last activity.

Back to the topic at hand, I'm doing it on PCOMM. It says here that it is version 6.0. This is the closest I got when checking the PCOMM manual. link but I still didn't figure out how to use the "Start Playing Macro (110)" indicated there.

Since the language indicated at the header is VBSCRIPT, I also tried doing this, but it seems it's only for .vbscript and not for .mac

Code:
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
   
dim ObjShell
Set objShell = CreateObject("WScript.Shell")
ObjShell.Run "cscript \\C:\ProgramData\IBM\Personal Communications\test_macro.mac"


If I map the keyboard, I can assign the PLAY function. The assigned key will have [Play]. I was thinking that after the PLAY function work, I just need to select the correct macro from there or maybe even have a parameter to accept what macro I want to run.

Out of curiosity, I even tried using these commands but still unable to do it.

Code:
autECLMacro "[Play]"


Code:
autECLSession.autECLPS.SendKeys "[Play]"
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 PRINTOUT macro PL/I & Assembler 0
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts Batch call online program, EXCI task ... CICS 3
Search our Forums:

Back to Top