MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CICS - REXX Interface

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Feb 17, 2003 12:38 am    Post subject: CICS - REXX Interface Reply with quote

Folks,

Is there some way to link CICS screens and REXX. My problem is this :
I need to enter some key value in a CICS screen, when I press an enter the corresponding record information is displayed(from backend)...in the same screen...
Now, I need to pick up a few fields from the screen and generate a report. I could hear you saying that you could directly go to the program corresponding to the screen, pick up the query and use the retrieved values.. But there are extremely complex computations after retrieving those values...Hence I just need the result of that program.....

Let me explan what i need in a nutshell..
1.The REXX program will read an I/P file for the key value
2.Execute the CICS screen corresponding to this key value
3.Get the corresponding Field value from CICS screen..

This process has to be repeated for all the key values...

Awaiting your replies.

Cheers,
Coolman.

P.S : Dont ask me to write a CICS/COBOL program for this... Laughing (Im not an expert at CICS)
________
Ferrari F1-2000


Last edited by coolman on Sat Feb 05, 2011 1:18 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Feb 17, 2003 4:49 am    Post subject: Reply with quote

I wonder if there are any simple and purely mainframe solution for this, we are using a tool (MDP) for doing similar job. But if you are willing to put your i/o files on a pc instead of mainframe then a macro in 3270 emulator will do this job pretty well.

If you give examples of step 1-3 and the emulator you are using then somebody might be able to provide the macro too.
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Feb 17, 2003 5:06 am    Post subject: Reply with quote

Dibakar,

Quote:

But if you are willing to put your i/o files on a pc instead of mainframe


The only file I was referring to contains nothing but the key values to the input file. I was also wondering as to how it would be done using a 3270 emulator macro..(well if it could be done, it would be really great).
I wanted something like trapping the CICS screen output that varies with each contract(this is also a big catch).

Thank you guys for your time...Well, If somebody knows the solution, plz.do let me know.

Cheers,
Coolman.
________
Maverick


Last edited by coolman on Sat Feb 05, 2011 1:18 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Feb 17, 2003 7:12 am    Post subject: Reply with quote

For Host Expolrer this modified sample may will provide required commands to help you to write your own macro -

Let Report.ebs be following file
Code:

'----------------------------------------------------------------------
'   To get data from Screen
'----------------------------------------------------------------------
 

'pressing keys
declare sub         PressAndWait    BasicLib "modules.ebx" (key$)

'writing text to screen
declare sub         WriteAtRowCol   BasicLib "modules.ebx" (key$, row%, col%)

'getting a row
declare function    TextFromRow     BasicLib "modules.ebx" (row%)

'getting a field
declare function    TextFromRowCol  BasicLib "modules.ebx" (row%, col%, ilen%)

dim    Policy   As String
dim    iFor     As Integer

sub main   

    'open input file
    Open InputBox$ ("Give Test Data File", , "c:\conseco\activepolicies\al70policies.txt")   For Input   As 101   


    'open output file
    Open "c:\conseco\out" + Date$ + ".txt"      For Append  As 201     

    'pressing key
    PressAndWait    "Clear"

    'reading input file
    do while eof( 101 ) <> -1

        'reading next record
        Input # 101 , Policy

        'writing on screen
        WriteAtRowCol   Left$ (Policy, 2), 4, 25

        'pressing a key
        PressAndWait    "Enter"

        'reading a row
        If "IDAS" <> TextFromRow (1) Then

            'reding a field
            If "U"  = TextFromRowCol (iFor, 8, 1) Then

                'writing to file
                Write # 201, Policy
            End If
        End If   
    loop

    'closing the files
    Close # 101 , # 201
end sub     

Let modules.ebs be following
Code:

Dim HostExplorer  As Object   
const iIdleTime   = 100

sub     WriteAtRowCol (text$, row%, col%)   '   Move cursor and write there 
        Set HostExplorer=CreateObject("HostExplorer")           ' Initialize HostExplorer Object
        HostExplorer.CurrentHost.Cfg3270.TypeAhead = True   ' Allow Type Ahead
        If row% * col% > 0 Then HostExplorer.CurrentHost.Cursor = (row% - 1) * 80 + col%
        HostExplorer.CurrentHost.Keys (text$)
end sub

function     TextFromRowCol (row%, col%, len_text%)   
        Set HostExplorer    = CreateObject("HostExplorer")       
        TextFromRowCol      = Trim$ (Mid$ (HostExplorer.CurrentHost.Row(row%), col%, len_text%))
end function

function     TextFromRow (row%)   
        Set HostExplorer    = CreateObject("HostExplorer")       
        TextFromRow         = Trim$ (HostExplorer.CurrentHost.Row(row%))
end function

sub     PressAndWait (key$)                 '   Press and wait 
        Set HostExplorer=CreateObject("HostExplorer")           ' Initialize HostExplorer Object
        HostExplorer.CurrentHost.Cfg3270.TypeAhead = True   ' Allow Type Ahead
        HostExplorer.CurrentHost.RunCmd (key$)
        HostExplorer.CurrentHost.WaitIdle (iIdleTime )   
end sub

Put modules and report in the same directory. Compile. Enter the CICS region and execute report macro. You can use multiple contracts and keys in your inpute file to execute required transactions and get a combined report.

Diba
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Feb 17, 2003 11:29 am    Post subject: Reply with quote

Dibakar,
Thanks for your time and help.

Quote:

Put modules and report in the same directory. Compile.

What exactly should I do here ??? and also where do I find manuals on how to go about coding PCOM macros

Cheers,
Coolman.
________
New Jersey Dispensary


Last edited by coolman on Sat Mar 12, 2011 8:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Feb 18, 2003 12:56 am    Post subject: Reply with quote

Coolman,

I have no knowledge of PCOM but in my emulator the regular help button on top right provides all information - how to record, edit, compile, run, syntax etc.

Diba.
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Feb 18, 2003 4:06 am    Post subject: Reply with quote

Dear All,

Dibakar, Thank you for the reply. Couple of observations :

1. HostExplorer, I suppose is an ActiveX component and the PCOM compiler shouts at me saying that it was not able to create it...

Hence, I did somethings on my own ...

Some Questions here :

1. autECLSession.autECLPS.GetText "10,1,20" , How do you assign it to a variable. which can be saved/displayed later...
Now,When you declare a variable, say for ex dim str1 as string...Again, this is a compilation error "Expected End of Statement"

2. How do we open a file from PCOM macro , Read a record from the file (Syntax)

I think If I can get the solution for the above 2 points, Im done with my job...
(So near yet so Far...Sometimes its worth tweaking with the PCOM macros too..)

Guys, If somebody knows or has a different idea Idea of doing this...Please feel free to share your thoughts

With Best Regards,
Coolman.
________
Honda of Canada Manufacturing history


Last edited by coolman on Sat Feb 05, 2011 1:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Feb 18, 2003 7:17 am    Post subject: Reply with quote

Coolman,

I am not good at VB, the macros I wrote are mostly by traial and error and based on some samples. To me "dim str1 as string" is perfectly okay. GetText does not look like a function since its parameters are not enclosed by braces, so I don't know if it can be assigned to a variable. I can't be of much help since ActiveX, PCOM all are unknown to me.

Hope you will get a better answer,
Diba
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Thu Feb 20, 2003 2:25 am    Post subject: Reply with quote

Dibakar,
Can you tell me what is the emulator you are using...Im using IBM PCOM v5.0

Cheers,
Coolman.
________
extreme vaporizer


Last edited by coolman on Sat Feb 05, 2011 1:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Feb 20, 2003 3:37 am    Post subject: Reply with quote

I am using Hummingbird - Host Explorer.

Dibakar.
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Thu Feb 20, 2003 7:24 am    Post subject: Reply with quote

Dibakar,
Thanks a bunch man.The funda is PCOM macros are extremely sensitive to the emulator that you are using.. Over the last 2 days, I learnt a lot (learnt what not to do Laughing, so to say about PCOM macros) and Thank GOD I finally coded the macro and its working...(not yet delivered though...)

Thank you once again...

Cheers,
Coolman.
________
Mercedes-Benz M138 engine history


Last edited by coolman on Sat Feb 05, 2011 1:19 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Feb 24, 2003 2:15 am    Post subject: Reply with quote

Good. Now you will possibly be writing a bunch of them.
Dibakar.
Back to top
View user's profile Send private message Send e-mail
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Feb 24, 2003 4:11 am    Post subject: Reply with quote

Folks,
Is there a way that you can swap across sessions, by using PCOM macros ?

Cheers,
Coolman.
________
bho hash oil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group