View previous topic :: View next topic |
Author |
Message |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Feb 17, 2003 12:38 am Post subject: CICS - REXX Interface |
|
|
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... (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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Feb 17, 2003 4:49 am Post subject: |
|
|
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 |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Feb 17, 2003 5:06 am Post subject: |
|
|
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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Feb 17, 2003 7:12 am Post subject: |
|
|
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 |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Feb 17, 2003 11:29 am Post subject: |
|
|
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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Feb 18, 2003 12:56 am Post subject: |
|
|
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 |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Tue Feb 18, 2003 4:06 am Post subject: |
|
|
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 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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Feb 18, 2003 7:17 am Post subject: |
|
|
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 |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Thu Feb 20, 2003 2:25 am Post subject: |
|
|
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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Feb 20, 2003 3:37 am Post subject: |
|
|
I am using Hummingbird - Host Explorer.
Dibakar. |
|
Back to top |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Thu Feb 20, 2003 7:24 am Post subject: |
|
|
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 , 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 |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Feb 24, 2003 2:15 am Post subject: |
|
|
Good. Now you will possibly be writing a bunch of them.
Dibakar. |
|
Back to top |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Feb 24, 2003 4:11 am Post subject: |
|
|
Folks,
Is there a way that you can swap across sessions, by using PCOM macros ?
Cheers,
Coolman.
________
bho hash oil |
|
Back to top |
|
 |
|
|