IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading HTML codes from webpages.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jul 14, 2011 5:58 pm
Reply with quote

Hello,

I am trying to access a webpage from mainframe, Is there anyway to read HTML code from WWW.

I have used SAS HTTP access to do this in some LPARS, but we do not have SAS licensed in all the LPARS. Please let me know if there is any other way to do this.

I would consider myself lucky if the solution is using REXX.


Thanks for viewing,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 14, 2011 6:36 pm
Reply with quote

If your site has the HTTP server set up, and the mainframe has access, it can be done. Find the IBM HTTP Server Bookshelf and read the HTTP Server: Planning, Installing, and Using manual -- especially Section 6 on Programming and section 6.1.10.2 on GCI REXX programming. You will be dealing with issues such as code page translation since the browswer is handling ASCII and the maifnrame is handling EBCDIC. It would be wise for you to consult with your site support group for assistance, especially since they may have changed the default port assignment.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jul 14, 2011 7:11 pm
Reply with quote

Hello Robert,

Thanks for your thought & direction.. Before starting with the 754 page pdf icon_sad.gif I would like to clarify one doubt..

The target website is hosted by third party web server on web(in this case Yahoo) is HTTP server still required on the mainframe end to access third party website?

I was having a perception that HTTP access would be something like FTP access, but it does not seem so :S

Regards,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 14, 2011 7:28 pm
Reply with quote

From my experience, HTTP access is nothing like FTP access.

I think I misunderstood what you want to do. It may be possible to do what you are asking but I've never heard of anyone doing so and have no idea how to accomplish it on a z/OS system.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jul 14, 2011 7:41 pm
Reply with quote

Quote:
I think I misunderstood what you want to do.

I agree.. my first post was misleading/unclear from 3rd person point of view.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Jul 14, 2011 7:47 pm
Reply with quote

I have no idea, other than obviously you'd need to open a TCP/IP socket to the proper server and port. Establish the ASCII-to-EBCDIC translation. Beyond that, I don't know the details of the HTTP protocol, so how the flow of data is handled, I can't say.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 14, 2011 9:04 pm
Reply with quote

ftp.software.ibm.com/s390/zos/vse/download/xmps/vseesoc.pdf
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jul 14, 2011 9:44 pm
Reply with quote

Thanks for the link Peter, your answers have always been short and sharp :-)
now I will go away and do 2 things.. 1) patiently read the stuff on the PDF link & comprehend the things on it.. 2) buy drinks for a network support colleague..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 14, 2011 10:13 pm
Reply with quote

Hi Vasanth,

Quote:
2) buy drinks for a network support colleague..
Bribery is often a good strategy . . . icon_cool.gif

Let us know how this proceeds.

d
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 14, 2011 11:12 pm
Reply with quote

Dick,

my advice and getting drinks for it has nothing to do with bribery.
My payments for my service(s) are/were always payed with booze and gals. ICT is a wonderfull business if you dont care about money, but prefer the payment in nature.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 14, 2011 11:20 pm
Reply with quote

vasanthz,

here is an example in a Rexx i had to maintain sending TCP/IP data from
MF to PC :

/**********************************************************************/
/* Calling real 'SOCKET' */
/**********************************************************************/
socket: PROCEDURE EXPOSE src
a0 = Arg(1)
a1 = Arg(2)
a2 = Arg(3)
a3 = Arg(4)
a4 = Arg(5)
a5 = Arg(6)
a6 = Arg(7)
a7 = Arg(8)
a8 = Arg(9)
a9 = Arg(10)
PARSE VALUE 'SOCKET'(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9) WITH src res
Return res


Call Socket 'Initialize',subtaskid,pnv_maxdesc,pnv_svcname
If src = 0 Then sockinited = 1
Else Do
return_code = src
Call Unable_to_initialize_Socket
End
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 14, 2011 11:28 pm
Reply with quote

for examples on how to start REXX socket programming see Your communication server library
*****.SEZAINST ( probably the HLQ is TCPIP ) and meditate on the EZARX*** members!

for accessing an url and extract data a good idea could be to lurk into the PC REXX applications .
iirc there are a few examples around and the socket part is pretty the same!

see also this thread on IBM MAIN
www.mail-archive.com/ibm-main@bama.ua.edu/msg137979.html

and googling for rexx socket programming examples will return many useful links
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 14, 2011 11:48 pm
Reply with quote

Hi Peter,

Quote:
My payments for my service(s) are/were always payed with booze and gals.
I can always buy more booze and my bride has this thing about my payment being in physical consideration from other females. . . icon_wink.gif

Actually, it is usually i that fund drinking/dining excursions. Sometimes ya gotta get them (clients) in the right mood to say what is really on their mind.

d
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 15, 2011 12:41 am
Reply with quote

Quote:

Actually, it is usually i that fund drinking/dining excursions. Sometimes ya gotta get them (clients) in the right mood to say what is really on their mind.


Dick,

drinking/dining excursions here in Holland is still called "getting them laid",
or is it what B.D. said "Times They Are A Changing "? icon_rolleyes.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jul 18, 2011 10:15 am
Reply with quote

Hello,
I got a code from the link Enrico provided, but there are some connectivity issue with that code at my site.. :S
Hopefully NET-ENG guys would resolve it soon.
Code:
61 ECONNREFUSED Connection refused


Here is the code, might be useful for someone else.
Code:
/*  rexx  */                                                       
/*  Make a connection to an http server, read the result and exit.
*/                                                                 
Host = 'www.ibm.com'                                               
Port = '80'                                                       
                                                                   
srv = Socket('Initialize', 'httpd')                               
srv= Socket('Socket')                                             
parse var srv src sockid                                           
srv = Socket('Ioctl',sockid,'FIONBIO','OFF' )                     
srv = Socket('Gethostbyname',Host)                                 
parse var srv src hostip                                           
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','SO_REUSEADDR','ON')
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','SO_LINGER','OFF')   
srv = Socket('Setsockopt',sockid,'SOL_SOCKET','TCP_NODELAY','OFF')
srv = Socket('Connect',sockid,'AF_INET' Port hostip)               
parse var srv src .                                               
If src > 0                                                         
  then do                                                         
     Say 'Unable to connect to' host':'port                       
     Say 'Socket connect error:' srv                               
     exit src                                                     
End                                                               
Exit 0
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Jul 18, 2011 12:06 pm
Reply with quote

firewall?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jul 18, 2011 12:20 pm
Reply with quote

Quote:
firewall?

I think so, I am not sure as I don't know anything about networks & the NET-ENG were using some terms used like NAT'ing, DNS, etc..

Also a issue of security was raised in allowing a client LPAR to access web.(which is a valid concern)
So to overcome this, we may fall back to using SAS in test LPAR and then FTP'ing the data.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Jul 18, 2011 12:36 pm
Reply with quote

Vasanthz,

i guess you didnt read the whole thread from enrico's link. There are some
pitfalls you can encounter. So i suggest to read the whole thread.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Jul 18, 2011 1:53 pm
Reply with quote

Vasanthz,

the next link gives you all info on rexx sockets :

publibz.boulder.ibm.com/epubs/pdf/f1a1d480.pdf
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Jul 19, 2011 12:34 pm
Reply with quote

Peter,
Thanks for the share.
I could try it out as a proof of concept for understanding purposes, since by the look of way things are going at our shop, we maybe asked to fall back of SAS and a test LPAR + FTP cos of security concerns.

Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts AI writing DFSORT, REXX codes.. All Other Mainframe Topics 3
No new posts Rexx program reading a DSN then write... CLIST & REXX 4
Search our Forums:

Back to Top