On Wed, Apr 26, 2017 at 7:55 AM, Bill Ashton <[email protected]> wrote:

> Hello again! I would like to know what you all are using to access web
> pages in batch JCL.
>
> I have some internal webpages (built from multiple systems) that contain
> particular information that I want to capture in a batch job, and then I
> will combine that with other data from other mainframe files. The easiest
> way is to grab the webpage in m batch job, and then I can use Rexx or Sort
> to parse through the HTML to get what I need.
>
> That's about all I can say on this project due to its sensitive nature.
> Please tell me your thoughts about how you would grab these web pages.
>
> Thanks!
> B
>

​Well, you could write an HTTP client in REXX using "REXX Sockets"
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.hala001/ipapirxa.htm

But, being a lazy SOB (Swell Ol' Boy, that is), I'd use REXX and the
bpxwunix() command to run the, optional, cURL command.

/* REXX */
STDIN.0=0
STDOUT.0=0
STDERR.0=0
CURL='/usr/lpp/ported/bin/curl'
cmd=curl" http://ibm.com";
RC=BPXWUNIX(cmd,stdin.,stdout.,stderr.)
do i=1 to stdout.0
   say "stdout."i"="stdout.i
end
do i=1 to stderr.0
   say 'stderr.'i'='stderr.i
end

Output looks like:

stdout.1=<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
stdout.2=<html><head>
stdout.3=<title>301 Moved Permanently</title>
stdout.4=</head><body>
stdout.5=<h1>Moved Permanently</h1>
stdout.6=<p>The document has moved <a href="http://www.ibm.com/
">here</a>.</p>
stdout.7=</body></html>
stderr.1=  % Total    % Received % Xferd  Average Speed   Time    Time
Time  Current
stderr.2=                                 Dload  Upload   Total   Spent
 Left  Speed
stderr.3=:100   227  100   227    0     0   1051      0 --:--:-- --:--:--
--:--:--  1051:100   227  100   227    0     0   1044
  0 --:--:-- --:--:-- --:--:--     0
***

​
-- 
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to