View previous topic :: View next topic
|
Author |
Message |
naseera
New User
Joined: 22 Nov 2010 Posts: 7 Location: Noida
|
|
|
|
Is there any process to copy/get a page in sequential file from a server in mainframe?
Thanks ! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You're going to have to be a lot clearer about what you are asking. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
naseera
New User
Joined: 22 Nov 2010 Posts: 7 Location: Noida
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
naseera
New User
Joined: 22 Nov 2010 Posts: 7 Location: Noida
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
I found this on the net ยง(Googling for ZOS rexx HTTP Client) :
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 |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
|