Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REXX to print the logical screen to a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Thu Feb 18, 2010 8:35 pm    Post subject: REXX to print the logical screen to a dataset
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 18, 2010 8:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Feb 18, 2010 9:08 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

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
http://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
View user's profile Send private message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Thu Feb 18, 2010 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Feb 18, 2010 9:13 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

OK... if that is the approach You feel comfortable with, why ask, just go ahead and start coding icon_wink.gif
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu Feb 18, 2010 9:25 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

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
View user's profile Send private message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Thu Feb 18, 2010 9:26 pm    Post subject:
Reply with quote

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. icon_smile.gif

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Feb 18, 2010 9:27 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

Isnt' there an ISPF System Variable, ZSCREENI, that contains the contents of the logical screen?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Feb 18, 2010 9:27 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu Feb 18, 2010 9:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Thu Feb 18, 2010 9:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Feb 18, 2010 10:08 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

untested.

something like this:
Code:

mycmd = 'print; list keep; end'
'CONTROL NONDISPL ENTER'
'DISPLAY PANEL(yourpanl) CMD(mycmd)'
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Thu Feb 18, 2010 10:19 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

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
View user's profile Send private message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Wed Feb 24, 2010 9:01 pm    Post subject: Reply to: REXX to print the logical screen to a dataset
Reply with quote

Thanks a lot folks!!
It worked! icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us