View previous topic :: View next topic
|
Author |
Message |
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
I do have a requirement to scrape the contents of the screen which will then be followed by string of processes with the extracted data. Therefore i need to code a REXX macro to first scrape the content of the screen to a dataset. Can you please give information on this?
On analysis, i found the command PRINT in the ISPF screen to copy the contents of the screen to LIST dataset. But I am yet to build something on this. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Your request is far from clear. Can you please explain in detail what it is that you want to achieve.
Which panel, an application ISPF panel where a user has entered fields, or a totally unrelated ISPF panel. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
MACRO ??
please use a better terminology , in the ISPF environment MACRO has a very specific meaning,
it usually means an edit macro!
if You google for ISPF screen scraping You will find many links on the pros/hows/cons
You might want to look at
www.sillysot.com/mvs/
ISPFHTML for some ideas
but if You want to scrape from an in house application, why not do the scraping from the application itself
see for example ISPF, most of the info You get from various lists can be
printed/scraped inside the application itself |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
Reqmt is simple here:
We have a panel which will display few fields on the screen. My requirement is particulary to extract data from the panel displayed. So as to achieve that, i felt that if we could copy the entire contents of the screen to a dataset, the dataset then could be parsed to extract the required information.
Hope you are clear. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
OK... if that is the approach You feel comfortable with, why ask, just go ahead and start coding |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
You are on the right track with PRINT. The tricks are to get the command to run and to get the output.
Your statement "Therefore i need to code a REXX macro to first scrap the content of the screen to a dataset." is incorrect however. You can scrape the screen and place it in a data set using a PF key assigned to PRINT;LIST KEEP which will print to the list, close the list data set. Then the Rexx needs to read that list data set to get whever you need. It should be easy to have the Rexx program find the data set automatically since there will be naming conventions for the list data set but you ought to delete it when you are done so that there is only one list file to look for.
If you are trying to capture screens for HTML or RTF (Word, etc), look for a program called ISPFHTML that will also capture colors. A 3rd option is to use your emulator to capture the screen either via simple cut. or using a fancier macro if the emulator supports that.
Oh.. and I forgot... there is also the ZSCREENI and ZSCREENC variables.
All of this assumes that the screens are not part of an application you are writing. If you are writing the application, then you already have the variables that are being displayed in the program. |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
For me to achieve this, i first need the screen contents to be scraped to a dataset. Rest of the process that needs to be done are clear.
I tried issuing PRINT command in command line and i got the screen content to the list dataset. I tried my REXX edit macro on the extracted data which executed as reqd.
My requirement is to issue PRINT command in my rexx script by addressing to a host environment. If i issue the command using TSO/ISPEXEC it executes the print dataset functionality.
Then i went abt this way,
"ISPEXEC SELECT PGM(ISPSTRT) PARM(PRINT) NEWAPPL(ISR) SUSPEND"
But the above statement opens up a new session and prints it to a LIST dataset. I do require the current session (which has got the panel displayed) to be printed to a dataset. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Isnt' there an ISPF System Variable, ZSCREENI, that contains the contents of the logical screen? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
We have a panel which will display few fields on the screen. My requirement is particulary to extract data from the panel displayed. |
but again I ask, is screen scraping a generalized(*)requirement or is application specific???
for example You could ( like ISPF does ) define a SAVE command
and do an intelligent save within the application itself?
( the data is application dependent anyway, so why not do it inside the application)
after a DISPLAY PANEL You still have available in the variables all the data displayed on the screen
easier to use the varaiables values than parse a print screen |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
As I mentiond above (but everyone is posting at the same time so you might miss it) the assumption that you need to use PRINT is probably faulty. If it is your program showing the screens, you already have the data in your program so just save it. If it is an application not under your control and you must use screen scraping, ZSCREENI is probably a better choice. (see my other comments above if you missed them though) |
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
Likely, we don't have the priviliges to mock the exisitng panel and moreover the panel which displays the information is proprietary.
Mbabu,
Is that a way possile to bring those commands to the REXX script. I am not able to execute the command at the right host environment. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
untested.
something like this:
Code: |
mycmd = 'print; list keep; end'
'CONTROL NONDISPL ENTER'
'DISPLAY PANEL(yourpanl) CMD(mycmd)' |
|
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
you can use the follow in your Rexx to capture the screen image
Code: |
"VGET (ZSCREENI ZSCREENW ZSCREEND)"
SW = ZSCREENW
SD = ZSCREEND
SL = ZSCREEND * ZSCREENW
DO I = 2 TO SL
QUEUE SUBSTR(ZSCREENI,I,SW)
I = I+79
END
"EXECIO" QUEUED() " DISKW CAPTURE (FINIS)"
|
|
|
Back to top |
|
|
pravinj
New User
Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
Thanks a lot folks!!
It worked! |
|
Back to top |
|
|
|