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
 

 

Mainframe : HTML page COPY/GET from a server

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
naseera

New User


Joined: 22 Nov 2010
Posts: 7
Location: Noida

PostPosted: Wed Jan 01, 2014 8:37 pm    Post subject: Mainframe : HTML page COPY/GET from a server
Reply with quote

Is there any process to copy/get a page in sequential file from a server in mainframe?

Thanks !
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Wed Jan 01, 2014 9:05 pm    Post subject: Reply to: Mainframe : HTML page COPY/GET from a server
Reply with quote

You're going to have to be a lot clearer about what you are asking.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Jan 01, 2014 10:05 pm    Post subject:
Reply with quote

Terminology is critical in IT, where similar terms may mean very different things. On a mainframe, sequential files have "records" -- NEVER pages. In fact, the only real use of the term "page" on the mainframe is to refer to 4096-byte blocks of main memory that can be swapped to disk as part of the operating system storage management process.

Furthermore, your question is not clear -- "copy/get" FROM where and TO where? Individual records or the entire file?

Perhaps if you provide a better explanation of what you want to know, we'll be able to provide clearer answers.
Back to top
View user's profile Send private message
naseera

New User


Joined: 22 Nov 2010
Posts: 7
Location: Noida

PostPosted: Wed Jan 01, 2014 10:39 pm    Post subject:
Reply with quote

ok.. Let me explain in details. I want to copy the text of an html page to a sequential file. For example like through NDM process we copy a .txt file from a destination directory to sequential file. I want copy the contents of an html page to a sequentail file. Is this possible?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Jan 01, 2014 11:40 pm    Post subject:
Reply with quote

The contents of an HTML page -- as long as you are NOT using a web browser to view it -- are merely text records. So the basic answer to your question is yes, you may copy HTML text to a sequential file. This file typically cannot be used in a web browser since web browsers do not handle mainframe file formats. There are some exceptions (IBM provides a way to display a sequential file in a web browser, for example), but the displayed text will be text, not HTML, typically.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jan 02, 2014 3:18 am    Post subject:
Reply with quote

Hello,

If you open a HTML file in notepad it is simple text tags, which means that the simple text tags are translated by web browser as neat webpages.

Is the HTML page hosted in "internet"? and you want to get that page into mainframe?

I think Mainframe SAS can do it, if SAS is allowed access to WWW, I have tried the below code in PC, it should work in mainframe as well(I hope SAS takes care of the ASCII to EBCDIC conversion automatically)
Code:
Filename www url 'http://knowyourmeme.com/memes/doge';
data _null_;
infile www url end=eof;
input;
file 'WELLS.SOME.OUTPUT.FILE';
put _infile_;
run;


If the html file is present in some file server location, then again filename statement in SAS can be modified to login to file server and access the html in same way.
Back to top
View user's profile Send private message
naseera

New User


Joined: 22 Nov 2010
Posts: 7
Location: Noida

PostPosted: Thu Jan 02, 2014 7:29 pm    Post subject:
Reply with quote

Robert, you replied below text: How to do this? can you give me an example through JCL/REXX?

<So the basic answer to your question is yes, you may copy HTML text to a sequential file.>


vasanthz, This REXX code is not working for me. I am not running in SAS environment.

Thanks !!
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Jan 02, 2014 7:52 pm    Post subject:
Reply with quote

Hello,

You need to work with Your support people. They can explain the specifics of ftp'ing a file to the mainframe.

You need to make sure it is the definition of the screen, not the data on the screen that you want to transfer.

I'm not clear on which you want . . .
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jan 02, 2014 7:56 pm    Post subject:
Reply with quote

Quote:
vasanthz, This REXX code is not working for me. I am not running in SAS environment.

The code was a SAS program.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Thu Jan 02, 2014 9:29 pm    Post subject:
Reply with quote

I found this on the net ยง(Googling for ZOS rexx HTTP Client) :
https://groups.google.com/forum/#!topic/bit.listserv.tsorexx/lk74hblwn3U

I have no idea if it works or not
As far as I can see written by Lindy Mayfield

Code:

/*  Rexx  */
/* A very simple Rexx program to "get" a web page */ Trace Off


/* Note that the parsing for this syntax wasn't done --
   http://my.server:8080/page  */

web_page = "http://your.server.com/your/webpage.html"
web_page = "http://www.sas.com/software/sas9/"

httpport = '80'
Verbose = 1
CRLF = '0D25'x

parse var web_page "http://"webserver"/"webfile

say "Getting file" webfile "from server" webserver

srv = Socket('Initialize', 'wget')
if verbose then
  say 'Socket Initialized ===>' srv

srv = Socket('GetHostId')
parse var srv src ipaddress
if verbose then
  say 'gethostid retd ===>' srv

srv= Socket('Socket')
parse var srv src ssockid
if verbose then
  say 'socket   retd   ===>' srv
if src > 0 then signal bye

srv = Socket('Gethostbyname',webserver)
parse var srv src serverip
if verbose then
  say 'gethbynm retd   ===>' srv

srv = Socket('Setsockopt',ssockid,'SOL_SOCKET','SO_REUSEADDR','ON')
parse var srv src
if verbose then
  say 'Setsockopt ===>' srv

srv = Socket('Setsockopt',ssockid,'SOL_SOCKET','SO_LINGER','OFF')
parse var srv src
if verbose then
  say 'Setsockopt ===>' srv

srv = Socket('Setsockopt',ssockid,'SOL_SOCKET','SO_ASCII','ON')
parse var srv src
if verbose then
  say 'Setsockopt ===>' srv

srv = Socket('Connect',ssockid,'AF_INET' httpport serverip) parse var srv src if verbose then
  say 'Connect    ===>' srv
If src > 0
  then do
     Say 'Connect to' webserver 'returned' srv
     Say 'Error: Aborting process'
     Return
End

Say ' '
Say 'Connected to server' webserver 'ip='serverip 'port='httpport Say ' '


/*
srv = Socket('Recv',ssockid)
parse var srv src len data

Say 'Server returned' len 'bytes of data:'
Say 'read>>' data
*/

say 'Sending HTTP request of' len 'bytes:'
httpget = 'GET' '/'webfile 'HTTP/1.0' CRLF srv = Socket('Send',ssockid,httpget) parse var srv src len say 'write>>' httpget

say 'Sending HTTP request of' len 'bytes:'
hosttxt = 'Host:' webserver':'httpport CRLF srv = Socket('Send',ssockid,hosttxt) parse var srv src len say 'write>>' hosttxt

/* Need one extra CRLF... */
srv = Socket('Send',ssockid,CRLF)
parse var srv src len

srv = Socket('Recv',ssockid)
parse var srv src len data

Say 'Server returned (headers)' len 'bytes of data:'
Say 'read>>' data

srv = Socket('Recv',ssockid)
parse var srv src len data

Say 'Server returned (data)' len 'bytes of data:'
Say 'read>>' data


bye:

srv = Socket('Close',ssockid)
if verbose then
  say 'Close returned ===>' srv
Say ' '
say 'Closing Connection to server.'
Say ' '

return
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Jan 02, 2014 10:11 pm    Post subject:
Reply with quote

I've used this and works OK. You have to make sure the Socket library is available.

I had to run this in batch so I could add that library to the steplib.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts FTP Server and FTP.DATA vasanthz All Other Mainframe Topics 2 Wed Oct 12, 2016 11:49 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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