Home > Archive > Rexx > October 2006 > Need a sample to congifure the searching message from a member of PDS
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need a sample to congifure the searching message from a member of PDS
|
|
| zufiel 2006-09-29, 7:03 pm |
| Hi,
I'm a beginner of programming with REXX.
While I try to code some program with REXX, I have many problem now.
My work is the following:
1. When I start the main rexx, list the messages on the panel.
2. Panel has 3 column - select, message id, message description.
3. When I select a message on list panel, the detail will be displayed
on another panel.
I can not code exactly and do no progress in coding.
If anyone have any sample and ideas, please let me know.
Regards,
JH
| |
| Mark V 2006-09-29, 7:03 pm |
| In comp.lang.rexx zufiel wrote:
> Hi,
> I'm a beginner of programming with REXX.
> While I try to code some program with REXX, I have many problem
> now. My work is the following:
>
> 1. When I start the main rexx, list the messages on the panel.
> 2. Panel has 3 column - select, message id, message description.
> 3. When I select a message on list panel, the detail will be
> displayed on another panel.
>
>
> I can not code exactly and do no progress in coding.
> If anyone have any sample and ideas, please let me know.
The first thing is tell us your operating system and REXX
implementation and version.
| |
| Mickey 2006-09-29, 7:03 pm |
|
Mark V wrote:
> In comp.lang.rexx zufiel wrote:
>
>
> The first thing is tell us your operating system and REXX
> implementation and version.
Panel would be the giveaway here. I suspect it is some flavor of MVS
(z/OS, etc) and ISPF, ergo TSO.
Mickey
| |
| zufiel 2006-09-30, 8:02 am |
|
Mark V wrote:
> In comp.lang.rexx zufiel wrote:
>
>
> The first thing is tell us your operating system and REXX
> implementation and version.
Operating system is z/OS 1.4 and REXX already had implemented.
The version of REXX is 1.4.
Would you let me know about your ideas and share some samples?
Regards,
JH
| |
| Mark V 2006-09-30, 7:04 pm |
| In comp.lang.rexx zufiel wrote:
>
> Mark V wrote:
[ ]
[color=darkred]
[color=darkred]
> Operating system is z/OS 1.4 and REXX already had implemented.
> The version of REXX is 1.4.
>
> Would you let me know about your ideas and share some samples?
Sorry, I cannot help as I run Regina REXX on Windows, DOS, Linux and
(previously OS/2).
| |
|
| "zufiel" <zufiel@daum.net> wrote in message
news:1159547645.421566.194540@k70g2000cwa.googlegroups.com...
> My work is the following:
> 1. When I start the main rexx, list the messages on the panel.
> 2. Panel has 3 column - select, message id, message description.
> 3. When I select a message on list panel, the detail will be displayed
> on another panel.
> If anyone have any sample and ideas, please let me know.
JH, I don't know exactly what you're trying to do from your description, but
I'm assuming you're trying to get the contents of your screen in ISPF. I've
included a REXX exec that will let you get the contents of your ISPF screen,
be that a certain line, the line the cursor is on, or the whole screen
itself. What you do with that is up to you; however, this exec, and the one
that calls it, must be in your SYSEXEC concatenation.
You need at least two execs:
1. @GETZSCR - the service exec that retrieves screen data
2. xxxxxxxx - the main exec that uses @GETZSCR to retrieve data & perform
some action on it
This may or may not work, depending on the specifics of whatever
panel/application you are using. The contents of your main exec
('xxxxxxxx') will have to account for any specific usage of that application
(note: I had originally designed this for CA-VIEW/SAR SYSOUT SELECTION
panels).
The @GETZSCR is at the very end of this post and will probably look terrible
if you're not using a fixed-width font to view this...
ISPF stores its screen data in various "ISPF SHARED variables", usually
beginning with the letter "Z". See the IBM ISPF manuals for more details:
http://publibz.boulder.ibm.com/cgi-...helves/ISPZPM10
If you are trying to develop an actual panel dialog application of some
kind, I can't help you with that because my knowledge is very small, but if
you want more information on how to develop dialog panels, buy these Mike
Murach books at http://www.murach.com (especially Part2):
MVS TSO, Part 1: Concepts and ISPF
MVS TSO, Part 2: Commands, CLIST, and REXX
To use @GETZSCR to obtain screen data do this:
Make the main exec, call it "GETMYSCR" and place it in your SYSEXEC
concatenation. GETMYSCR should look like this:
/* REXX - GETMYSCR: get ISPF screen data & parse it. */
/* This exec will get the line that the cursor is on and parse it. */
/* get line# that the cursor is on */
line# = @GETZSCR('CURSORLINE#')
/* get the text of the cursor's line */
line = @GETZSCR('GETLINE',line#)
/* put the line's fields into seperate vars */
PARSE VAR line select msg_id msg_desc
/* display the line's fields */
SAY "The SELECT column is:" select
SAY "The MESSAGE ID column is:" msg_id
SAY "The DESCRIPTION column is:" msg_desc
/* perform some function on that data here.... */
EXIT 0
Now that you have both @GETZSCR and GETMYSCR in your SYSEXEC concat., go to
the panel you want and type this on the main command line:
TSO GETMYSCR
If you've named the main exec something differently, you would use that name
instead:
TSO membername
If you want to pass an argument line to the main exec, add the parms to the
end of the TSO command and they will all be passed as a single arg:
TSO membername parms
Hope this helps.
- John
Here is the @GETZSCR exec (note: on my news reader's fonts, the lower-case
"L" looks like a number "1", don't confuse the two):
/* REXX - Created 08/07/06. @GETZSCR: Get ISPF ZSCREEN var data.*/
/* This module will get screen data from ISPF ZSCREENx SHARED vars. */
/* See IBM's "ISPF Reference Summary", chapter 5, for variable info. */
/* */
/* PURPOSE: Use to retrieve data from current screen in ISPF session*/
/* */
/* PARMs: Parms consist of seperate args, 1st of which is the */
/* function to perform (what type of data to get). The 2nd*/
/* is only required for certain functions (eg 'GETLINE'). */
/* */
/* FUNCTION: CURSORCHAR = get character under current cursor pos. */
/* CURSORLINE = get line text under current cursor pos. */
/* CURSORLINE# = get line# cursor is currently on */
/* CURSORPOS = get current cursor pos (offset of 0) */
/* GETLINE,# = get text of line# ?, pass line# as 2nd arg*/
/* SCREENSIZE = get scr size, www hhh (w=width,h=height) */
/* SCREENTEXT = get entire screen contents' text */
/* */
/* EXAMPLE: ret = @GETZSCR('CURSORCHAR') character under cursor */
/* ret = @GETZSCR('CURSORLINE') text of cursor's line */
/* ret = @GETZSCR('CURSORLINE#') maybe '4' */
/* ret = @GETZSCR('CURSORPOS') maybe '00254' */
/* ret = @GETZSCR('GETLINE',5) text of line 5 */
/* ret = @GETZSCR('SCREENSIZE') maybe '0080 0024' */
/* ret = @GETZSCR('SCREENTEXT') entire screen */
/* */
/* RETURNs: Will return the info. requested by the function. If a */
/* function is omitted or invalid, returns 0. If function */
/* is valid, but data isn't (eg call to GETLINE,0 or a line*/
/* outside the screen's range), usually returns blank. */
/* */
/* NOTE: Text returned from a file with NULLS ON in the ISPF PRO-*/
/* FILE will represent the NULLs as a dot char (.), even */
/* though they are blank on the screen in the file itself. */
/* */
/*-------------------------------------------------------------------*/
/* CHANGES - */
/* Date Who Change# Description */
/* --------+---+----------+----------------------------------------- */
/* 08/07/06 JPW Initial code design & development. */
/ ****************************************
*****************************/
PARSE SOURCE . calltype exname .
/* verify in ISPF, else issue warning*/
CALL Check_ISPF
/* get ISPF ZSCREENx vars, abbreviate them */
env = ADDRESS()
ADDRESS ISPEXEC
"VGET (ZSCREENC)" ; zc = zscreenc /* cursor pos offset, from (0,0) */
"VGET (ZSCREENI)" ; zi = zscreeni /* logical screen info (contents)*/
"VGET (ZSCREENW)" ; zw = zscreenw /* screen width */
"VGET (ZSCREEND)" ; zd = zscreend /* screen depth (height) */
"VGET (ZSCRCUR)" ; z## = zscrcur /* log. screens currently in use */
"VGET (ZSCREEN)" ; z# = zscreen /* logical screen number */
"VGET (ZSCRMAX)" ; zm# = zscrmax /* max logical screens allowed */
"VGET (ZSCRMAXD)" ; zmd = zscrmaxd /* max screen depth */
"VGET (ZSCRMAXW)" ; zmw = zscrmaxw /* max screen width */
"VGET (ZSCRNAME)" ; zn = zscrname /* dialog screen name */
ADDRESS env
/* return requested info */
fx = TRANSLATE(STRIP(ARG(1))) /* function to perform */
opt1 = TRANSLATE(STRIP(ARG(2))) /* option 1 */
cl = Cursor_Line(zc,zw) /* line# of cursor position */
clt = Get_Line(cl,zw,zd,zi) /* text of current cursor line */
SELECT
WHEN fx = "CURSORCHAR" THEN rcx = SUBSTR(zi,zc + 1,1)
WHEN fx = "CURSORLINE" THEN rcx = clt
WHEN fx = "CURSORLINE#" THEN rcx = cl
WHEN fx = "CURSORPOS" THEN rcx = zc
WHEN fx = "GETLINE" THEN rcx = Get_Line(opt1,zw,zd,zi)
WHEN fx = "SCREENSIZE" THEN rcx = zw zd
WHEN fx = "SCREENTEXT" THEN rcx = zi
OTHERWISE rcx = 0
END
CALL Exit_Now rcx
Exit_Now:
PARSE ARG rc_x
EXIT rc_x
/***************/
/* SUBROUTINES */
/***************/
Get_Line: PROCEDURE
/* return the contents of passed line# */
/* args = line#, width, depth, contents*/
/* invalid line # returns blank */
PARSE ARG l# , zw , zd , zi
IF l# < 1 | l# > zd | ^DATATYPE(l#,'NUM') THEN line = ""
ELSE line = SUBSTR(zi,Line_Start(l#,zw),zw)
RETURN line
Cursor_Line: PROCEDURE
/* pass cursor position & ZSCREENW, returns line num it's on */
PARSE ARG zc , zw
l# = 1
DO WHILE zc % zw > 0
l# = l# + 1
zc = zc - zw
END
RETURN l#
Line_Start: PROCEDURE
/* pass line num & ZSCREENW, returns start pos of that line */
/* note this func returns (offset + 1), meant to */
/* be used in a SUBSTR on ZSCREENI so */
/* subtract 1 from 'linex' for true (x,y) co-ords */
PARSE ARG l# , zw
linex = 1 + (l# - 1) * zw
RETURN linex
Check_ISPF: PROCEDURE
/* verify running under ISPF dialog manager services */
/* exit w/ rc0 if not */
PARSE SOURCE . . exname . . . . addrspace .
ispf = 0
IF addrspace = "ISPF" THEN IF SYSVAR('SYSISPF') = "ACTIVE" THEN ispf = 1
IF ispf THEN RETURN 0
SAY exname "must run in ISPF"
CALL Exit_Now 0
| |
| Binyamin Dissen 2006-09-30, 7:04 pm |
| On 29 Sep 2006 09:34:05 -0700 "zufiel" <zufiel@daum.net> wrote:
:>I'm a beginner of programming with REXX.
:>While I try to code some program with REXX, I have many problem now.
:>My work is the following:
:>1. When I start the main rexx, list the messages on the panel.
:>2. Panel has 3 column - select, message id, message description.
:>3. When I select a message on list panel, the detail will be displayed
:>on another panel.
:>I can not code exactly and do no progress in coding.
:>If anyone have any sample and ideas, please let me know.
Sounds like you were hired for a job without the skills to do the job.
Show a flowchart for the problem.
How would you code in another language?
--
Binyamin Dissen <bdissen@dissensoftware.com>
http://www.dissensoftware.com
Director, Dissen Software, Bar & Grill - Israel
Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.
I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
| |
| zufiel 2006-10-01, 4:02 am |
|
John =EC=9E=91=EC=84=B1:
> "zufiel" <zufiel@daum.net> wrote in message
> news:1159547645.421566.194540@k70g2000cwa.googlegroups.com...
>
> JH, I don't know exactly what you're trying to do from your description, =
but
> I'm assuming you're trying to get the contents of your screen in ISPF. I=
've
> included a REXX exec that will let you get the contents of your ISPF scre=
en,
> be that a certain line, the line the cursor is on, or the whole screen
> itself. What you do with that is up to you; however, this exec, and the =
one
> that calls it, must be in your SYSEXEC concatenation.
>
> You need at least two execs:
> 1. @GETZSCR - the service exec that retrieves screen data
> 2. xxxxxxxx - the main exec that uses @GETZSCR to retrieve data & perform
> some action on it
>
> This may or may not work, depending on the specifics of whatever
> panel/application you are using. The contents of your main exec
> ('xxxxxxxx') will have to account for any specific usage of that applicat=
ion
> (note: I had originally designed this for CA-VIEW/SAR SYSOUT SELECTION
> panels).
>
> The @GETZSCR is at the very end of this post and will probably look terri=
ble
> if you're not using a fixed-width font to view this...
>
> ISPF stores its screen data in various "ISPF SHARED variables", usually
> beginning with the letter "Z". See the IBM ISPF manuals for more details:
> http://publibz.boulder.ibm.com/cgi-...helves/ISPZPM10
>
> If you are trying to develop an actual panel dialog application of some
> kind, I can't help you with that because my knowledge is very small, but =
if
> you want more information on how to develop dialog panels, buy these Mike
> Murach books at http://www.murach.com (especially Part2):
> MVS TSO, Part 1: Concepts and ISPF
> MVS TSO, Part 2: Commands, CLIST, and REXX
>
>
> To use @GETZSCR to obtain screen data do this:
>
> Make the main exec, call it "GETMYSCR" and place it in your SYSEXEC
> concatenation. GETMYSCR should look like this:
> /* REXX - GETMYSCR: get ISPF screen data & parse it. */
> /* This exec will get the line that the cursor is on and parse it. */
>
> /* get line# that the cursor is on */
> line# =3D @GETZSCR('CURSORLINE#')
>
> /* get the text of the cursor's line */
> line =3D @GETZSCR('GETLINE',line#)
>
> /* put the line's fields into seperate vars */
> PARSE VAR line select msg_id msg_desc
>
> /* display the line's fields */
> SAY "The SELECT column is:" select
> SAY "The MESSAGE ID column is:" msg_id
> SAY "The DESCRIPTION column is:" msg_desc
>
> /* perform some function on that data here.... */
>
> EXIT 0
>
>
> Now that you have both @GETZSCR and GETMYSCR in your SYSEXEC concat., go =
to
> the panel you want and type this on the main command line:
> TSO GETMYSCR
>
> If you've named the main exec something differently, you would use that n=
ame
> instead:
> TSO membername
>
> If you want to pass an argument line to the main exec, add the parms to t=
he
> end of the TSO command and they will all be passed as a single arg:
> TSO membername parms
>
> Hope this helps.
> - John
>
>
>
> Here is the @GETZSCR exec (note: on my news reader's fonts, the lower-case
> "L" looks like a number "1", don't confuse the two):
>
> /* REXX - Created 08/07/06. @GETZSCR: Get ISPF ZSCREEN var data.*/
> /* This module will get screen data from ISPF ZSCREENx SHARED vars. */
> /* See IBM's "ISPF Reference Summary", chapter 5, for variable info. */
> /* */
> /* PURPOSE: Use to retrieve data from current screen in ISPF session*/
> /* */
> /* PARMs: Parms consist of seperate args, 1st of which is the */
> /* function to perform (what type of data to get). The 2nd*/
> /* is only required for certain functions (eg 'GETLINE'). */
> /* */
> /* FUNCTION: CURSORCHAR =3D get character under current cursor pos. */
> /* CURSORLINE =3D get line text under current cursor pos. */
> /* CURSORLINE# =3D get line# cursor is currently on */
> /* CURSORPOS =3D get current cursor pos (offset of 0) */
> /* GETLINE,# =3D get text of line# ?, pass line# as 2nd arg*/
> /* SCREENSIZE =3D get scr size, www hhh (w=3Dwidth,h=3Dheight=
) */
> /* SCREENTEXT =3D get entire screen contents' text */
> /* */
> /* EXAMPLE: ret =3D @GETZSCR('CURSORCHAR') character under cursor */
> /* ret =3D @GETZSCR('CURSORLINE') text of cursor's line */
> /* ret =3D @GETZSCR('CURSORLINE#') maybe '4' */
> /* ret =3D @GETZSCR('CURSORPOS') maybe '00254' */
> /* ret =3D @GETZSCR('GETLINE',5) text of line 5 */
> /* ret =3D @GETZSCR('SCREENSIZE') maybe '0080 0024' */
> /* ret =3D @GETZSCR('SCREENTEXT') entire screen */
> /* */
> /* RETURNs: Will return the info. requested by the function. If a */
> /* function is omitted or invalid, returns 0. If function */
> /* is valid, but data isn't (eg call to GETLINE,0 or a line*/
> /* outside the screen's range), usually returns blank. */
> /* */
> /* NOTE: Text returned from a file with NULLS ON in the ISPF PRO-*/
> /* FILE will represent the NULLs as a dot char (.), even */
> /* though they are blank on the screen in the file itself. */
> /* */
> /*-------------------------------------------------------------------*/
> /* CHANGES - */
> /* Date Who Change# Description */
> /* --------+---+----------+----------------------------------------- */
> /* 08/07/06 JPW Initial code design & development. */
> / ****************************************
*****************************/
> PARSE SOURCE . calltype exname .
>
> /* verify in ISPF, else issue warning*/
> CALL Check_ISPF
>
> /* get ISPF ZSCREENx vars, abbreviate them */
> env =3D ADDRESS()
> ADDRESS ISPEXEC
> "VGET (ZSCREENC)" ; zc =3D zscreenc /* cursor pos offset, from (0,0) */
> "VGET (ZSCREENI)" ; zi =3D zscreeni /* logical screen info (contents)*/
> "VGET (ZSCREENW)" ; zw =3D zscreenw /* screen width */
> "VGET (ZSCREEND)" ; zd =3D zscreend /* screen depth (height) */
> "VGET (ZSCRCUR)" ; z## =3D zscrcur /* log. screens currently in use */
> "VGET (ZSCREEN)" ; z# =3D zscreen /* logical screen number */
> "VGET (ZSCRMAX)" ; zm# =3D zscrmax /* max logical screens allowed */
> "VGET (ZSCRMAXD)" ; zmd =3D zscrmaxd /* max screen depth */
> "VGET (ZSCRMAXW)" ; zmw =3D zscrmaxw /* max screen width */
> "VGET (ZSCRNAME)" ; zn =3D zscrname /* dialog screen name */
> ADDRESS env
>
> /* return requested info */
> fx =3D TRANSLATE(STRIP(ARG(1))) /* function to perform */
> opt1 =3D TRANSLATE(STRIP(ARG(2))) /* option 1 */
> cl =3D Cursor_Line(zc,zw) /* line# of cursor position */
> clt =3D Get_Line(cl,zw,zd,zi) /* text of current cursor line */
> SELECT
> WHEN fx =3D "CURSORCHAR" THEN rcx =3D SUBSTR(zi,zc + 1,1)
> WHEN fx =3D "CURSORLINE" THEN rcx =3D clt
> WHEN fx =3D "CURSORLINE#" THEN rcx =3D cl
> WHEN fx =3D "CURSORPOS" THEN rcx =3D zc
> WHEN fx =3D "GETLINE" THEN rcx =3D Get_Line(opt1,zw,zd,zi)
> WHEN fx =3D "SCREENSIZE" THEN rcx =3D zw zd
> WHEN fx =3D "SCREENTEXT" THEN rcx =3D zi
> OTHERWISE rcx =3D 0
> END
> CALL Exit_Now rcx
>
>
> Exit_Now:
> PARSE ARG rc_x
> EXIT rc_x
>
>
> /***************/
> /* SUBROUTINES */
> /***************/
>
> Get_Line: PROCEDURE
> /* return the contents of passed line# */
> /* args =3D line#, width, depth, contents*/
> /* invalid line # returns blank */
> PARSE ARG l# , zw , zd , zi
> IF l# < 1 | l# > zd | ^DATATYPE(l#,'NUM') THEN line =3D ""
> ELSE line =3D SUBSTR(zi,Line_Start(l#,zw),zw)
> RETURN line
>
>
> Cursor_Line: PROCEDURE
> /* pass cursor position & ZSCREENW, returns line num it's on */
> PARSE ARG zc , zw
> l# =3D 1
> DO WHILE zc % zw > 0
> l# =3D l# + 1
> zc =3D zc - zw
> END
> RETURN l#
>
>
> Line_Start: PROCEDURE
> /* pass line num & ZSCREENW, returns start pos of that line */
> /* note this func returns (offset + 1), meant to */
> /* be used in a SUBSTR on ZSCREENI so */
> /* subtract 1 from 'linex' for true (x,y) co-ords */
> PARSE ARG l# , zw
> linex =3D 1 + (l# - 1) * zw
> RETURN linex
>
>
> Check_ISPF: PROCEDURE
> /* verify running under ISPF dialog manager services */
> /* exit w/ rc0 if not */
> PARSE SOURCE . . exname . . . . addrspace .
> ispf =3D 0
> IF addrspace =3D "ISPF" THEN IF SYSVAR('SYSISPF') =3D "ACTIVE" THEN ispf =
=3D 1
> IF ispf THEN RETURN 0
> SAY exname "must run in ISPF"
> CALL Exit_Now 0
Thanks.
I understand a little what I have to do. But I'm worry how I can code a
program that shows
the message's detail on any panel.
So would you share your experience and ideas about panel and exec that
display the deatil on the panel?=20
JH
| |
| Shmuel (Seymour J.) Metz 2006-10-01, 7:05 pm |
| In <1159624282.786006.238680@m7g2000cwm.googlegroups.com>, on
09/30/2006
at 06:51 AM, "zufiel" <zufiel@daum.net> said:
>Would you let me know about your ideas and share some samples?
First, read the ISPF documentation, especially Dialog Manager and
Table Services. Second Join the ISPF-L or IBM-MAIN mailing list and
ask for help there.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
| |
|
|
"zufiel" <zufiel@daum.net> wrote in message
news:1159694867.106518.247940@e3g2000cwe.googlegroups.com...
John ??:
> "zufiel" <zufiel@daum.net> wrote in message
> news:1159547645.421566.194540@k70g2000cwa.googlegroups.com...
>
> JH, I don't know exactly what you're trying to do from your description,
> but
> I'm assuming you're trying to get the contents of your screen in ISPF.
> I've
> included a REXX exec that will let you get the contents of your ISPF
> screen,
> be that a certain line, the line the cursor is on, or the whole screen
> itself. What you do with that is up to you; however, this exec, and the
> one
> that calls it, must be in your SYSEXEC concatenation.
>
> You need at least two execs:
> 1. @GETZSCR - the service exec that retrieves screen data
> 2. xxxxxxxx - the main exec that uses @GETZSCR to retrieve data & perform
> some action on it
>
> This may or may not work, depending on the specifics of whatever
> panel/application you are using. The contents of your main exec
> ('xxxxxxxx') will have to account for any specific usage of that
> application
> (note: I had originally designed this for CA-VIEW/SAR SYSOUT SELECTION
> panels).
>
> The @GETZSCR is at the very end of this post and will probably look
> terrible
> if you're not using a fixed-width font to view this...
>
> ISPF stores its screen data in various "ISPF SHARED variables", usually
> beginning with the letter "Z". See the IBM ISPF manuals for more details:
> http://publibz.boulder.ibm.com/cgi-...helves/ISPZPM10
>
> If you are trying to develop an actual panel dialog application of some
> kind, I can't help you with that because my knowledge is very small, but
> if
> you want more information on how to develop dialog panels, buy these Mike
> Murach books at http://www.murach.com (especially Part2):
> MVS TSO, Part 1: Concepts and ISPF
> MVS TSO, Part 2: Commands, CLIST, and REXX
>
>
> To use @GETZSCR to obtain screen data do this:
>
> Make the main exec, call it "GETMYSCR" and place it in your SYSEXEC
> concatenation. GETMYSCR should look like this:
> /* REXX - GETMYSCR: get ISPF screen data & parse it. */
> /* This exec will get the line that the cursor is on and parse it. */
>
> /* get line# that the cursor is on */
> line# = @GETZSCR('CURSORLINE#')
>
> /* get the text of the cursor's line */
> line = @GETZSCR('GETLINE',line#)
>
> /* put the line's fields into seperate vars */
> PARSE VAR line select msg_id msg_desc
>
> /* display the line's fields */
> SAY "The SELECT column is:" select
> SAY "The MESSAGE ID column is:" msg_id
> SAY "The DESCRIPTION column is:" msg_desc
>
> /* perform some function on that data here.... */
>
> EXIT 0
>
>
> Now that you have both @GETZSCR and GETMYSCR in your SYSEXEC concat., go
> to
> the panel you want and type this on the main command line:
> TSO GETMYSCR
>
> If you've named the main exec something differently, you would use that
> name
> instead:
> TSO membername
>
> If you want to pass an argument line to the main exec, add the parms to
> the
> end of the TSO command and they will all be passed as a single arg:
> TSO membername parms
>
> Hope this helps.
> - John
>
>
>
> Here is the @GETZSCR exec (note: on my news reader's fonts, the lower-case
> "L" looks like a number "1", don't confuse the two):
>
> /* REXX - Created 08/07/06. @GETZSCR: Get ISPF ZSCREEN var data.*/
> /* This module will get screen data from ISPF ZSCREENx SHARED vars. */
> /* See IBM's "ISPF Reference Summary", chapter 5, for variable info. */
> /* */
> /* PURPOSE: Use to retrieve data from current screen in ISPF session*/
> /* */
> /* PARMs: Parms consist of seperate args, 1st of which is the */
> /* function to perform (what type of data to get). The 2nd*/
> /* is only required for certain functions (eg 'GETLINE'). */
> /* */
> /* FUNCTION: CURSORCHAR = get character under current cursor pos. */
> /* CURSORLINE = get line text under current cursor pos. */
> /* CURSORLINE# = get line# cursor is currently on */
> /* CURSORPOS = get current cursor pos (offset of 0) */
> /* GETLINE,# = get text of line# ?, pass line# as 2nd arg*/
> /* SCREENSIZE = get scr size, www hhh (w=width,h=height) */
> /* SCREENTEXT = get entire screen contents' text */
> /* */
> /* EXAMPLE: ret = @GETZSCR('CURSORCHAR') character under cursor */
> /* ret = @GETZSCR('CURSORLINE') text of cursor's line */
> /* ret = @GETZSCR('CURSORLINE#') maybe '4' */
> /* ret = @GETZSCR('CURSORPOS') maybe '00254' */
> /* ret = @GETZSCR('GETLINE',5) text of line 5 */
> /* ret = @GETZSCR('SCREENSIZE') maybe '0080 0024' */
> /* ret = @GETZSCR('SCREENTEXT') entire screen */
> /* */
> /* RETURNs: Will return the info. requested by the function. If a */
> /* function is omitted or invalid, returns 0. If function */
> /* is valid, but data isn't (eg call to GETLINE,0 or a line*/
> /* outside the screen's range), usually returns blank. */
> /* */
> /* NOTE: Text returned from a file with NULLS ON in the ISPF PRO-*/
> /* FILE will represent the NULLs as a dot char (.), even */
> /* though they are blank on the screen in the file itself. */
> /* */
> /*-------------------------------------------------------------------*/
> /* CHANGES - */
> /* Date Who Change# Description */
> /* --------+---+----------+----------------------------------------- */
> /* 08/07/06 JPW Initial code design & development. */
> / ****************************************
*****************************/
> PARSE SOURCE . calltype exname .
>
> /* verify in ISPF, else issue warning*/
> CALL Check_ISPF
>
> /* get ISPF ZSCREENx vars, abbreviate them */
> env = ADDRESS()
> ADDRESS ISPEXEC
> "VGET (ZSCREENC)" ; zc = zscreenc /* cursor pos offset, from (0,0) */
> "VGET (ZSCREENI)" ; zi = zscreeni /* logical screen info (contents)*/
> "VGET (ZSCREENW)" ; zw = zscreenw /* screen width */
> "VGET (ZSCREEND)" ; zd = zscreend /* screen depth (height) */
> "VGET (ZSCRCUR)" ; z## = zscrcur /* log. screens currently in use */
> "VGET (ZSCREEN)" ; z# = zscreen /* logical screen number */
> "VGET (ZSCRMAX)" ; zm# = zscrmax /* max logical screens allowed */
> "VGET (ZSCRMAXD)" ; zmd = zscrmaxd /* max screen depth */
> "VGET (ZSCRMAXW)" ; zmw = zscrmaxw /* max screen width */
> "VGET (ZSCRNAME)" ; zn = zscrname /* dialog screen name */
> ADDRESS env
>
> /* return requested info */
> fx = TRANSLATE(STRIP(ARG(1))) /* function to perform */
> opt1 = TRANSLATE(STRIP(ARG(2))) /* option 1 */
> cl = Cursor_Line(zc,zw) /* line# of cursor position */
> clt = Get_Line(cl,zw,zd,zi) /* text of current cursor line */
> SELECT
> WHEN fx = "CURSORCHAR" THEN rcx = SUBSTR(zi,zc + 1,1)
> WHEN fx = "CURSORLINE" THEN rcx = clt
> WHEN fx = "CURSORLINE#" THEN rcx = cl
> WHEN fx = "CURSORPOS" THEN rcx = zc
> WHEN fx = "GETLINE" THEN rcx = Get_Line(opt1,zw,zd,zi)
> WHEN fx = "SCREENSIZE" THEN rcx = zw zd
> WHEN fx = "SCREENTEXT" THEN rcx = zi
> OTHERWISE rcx = 0
> END
> CALL Exit_Now rcx
>
>
> Exit_Now:
> PARSE ARG rc_x
> EXIT rc_x
>
>
> /***************/
> /* SUBROUTINES */
> /***************/
>
> Get_Line: PROCEDURE
> /* return the contents of passed line# */
> /* args = line#, width, depth, contents*/
> /* invalid line # returns blank */
> PARSE ARG l# , zw , zd , zi
> IF l# < 1 | l# > zd | ^DATATYPE(l#,'NUM') THEN line = ""
> ELSE line = SUBSTR(zi,Line_Start(l#,zw),zw)
> RETURN line
>
>
> Cursor_Line: PROCEDURE
> /* pass cursor position & ZSCREENW, returns line num it's on */
> PARSE ARG zc , zw
> l# = 1
> DO WHILE zc % zw > 0
> l# = l# + 1
> zc = zc - zw
> END
> RETURN l#
>
>
> Line_Start: PROCEDURE
> /* pass line num & ZSCREENW, returns start pos of that line */
> /* note this func returns (offset + 1), meant to */
> /* be used in a SUBSTR on ZSCREENI so */
> /* subtract 1 from 'linex' for true (x,y) co-ords */
> PARSE ARG l# , zw
> linex = 1 + (l# - 1) * zw
> RETURN linex
>
>
> Check_ISPF: PROCEDURE
> /* verify running under ISPF dialog manager services */
> /* exit w/ rc0 if not */
> PARSE SOURCE . . exname . . . . addrspace .
> ispf = 0
> IF addrspace = "ISPF" THEN IF SYSVAR('SYSISPF') = "ACTIVE" THEN ispf = 1
> IF ispf THEN RETURN 0
> SAY exname "must run in ISPF"
> CALL Exit_Now 0
Thanks.
I understand a little what I have to do. But I'm worry how I can code a
program that shows
the message's detail on any panel.
So would you share your experience and ideas about panel and exec that
display the deatil on the panel?
JH
JH, ROFL, I just did!
|
|
|
|
|