Code: |
//STEP0001 EXEC SAS //SAS.SASLOG DD SYSOUT=* //SAS.SYSDUMP DD SYSOUT=* //SAS.SASLIST DD SYSOUT=* //T1 DD DSN=&SYSUID..T1,DISP=(,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(1,1)) //SASUSER DD UNIT=VIO,SPACE=(TRK,(10,10),RLSE) //SYSTCPD DD DSN=HLQ.TCPIP.SEZAINST(TCPDATB1),DISP=SHR //SYSIN DD DATA FILENAME READHTM1 URL 'http://server:port/directory/file.html'; DATA _NULL_; INFILE READHTM1 LENGTH=LEN; INPUT RECORD $VARYING256. LEN; FILE T1 NOPRINT NOTITLES LRECL=256; PUT RECORD $VARYING256. LEN; RUN; /* //* |
kolusu wrote: |
Can you use ISPF Work station agent? |
Code: |
<DSV> <MAINFRAME>SUCCESS</MAINFRAME> <SUNGARD>SUCCESS</SUNGARD> .... </DSV> |
Quote: |
There must be a special process to connect to a url instead of an actual server (like we already do with the SMTP servers), so I'll keep digging for an answer. |
Code: |
/* REXX */
/*------------------------------------------------------------------*/ /* */ /* Name: MISCLIEN - Miscellaneous client program */ /* */ /* Function: Tests the three following protocols available in */ /* the Miscellaneous Server using TCP protocol. */ /* ECHO protocol (PORT 7) */ /* DISCARD protocol (PORT 9) */ /* CHARACTER GENERATOR (PORT 19) */ /* */ /* Interface: - none - */ /* */ /* Logic: The REXX program sends the message ' Are you There ?' */ /* to the MISCSERV Server over a socket connection. */ /* 1- When using ECHO protocol (tpiport=7), MISCSERV */ /* sends back the ' Are You There ?' message. */ /* 2- When using DISCARD protocol (tpiport=9), MISCSERV */ /* throws away the ' Are You There ?' message and */ /* send no response. */ /* 3- When using CHARACTER GENERATOR protocol */ /* (tpiport=19), MISCSERV sends back the */ /* Character Generator Data. */ /* */ /* Returncode: RC = 0, processing OK */ /* Everything else is non-successful return code */ /* from socket interface */ /* */ /* Written: June the 10' th 1994 at ITSO Raleigh */ /* */ /* Changes: */ /* */ /*------------------------------------------------------------------*/ parse upper arg tpiport actrace = 1 /*Controls tracing */ record = ' Are You There ?' /*Message test */ tpiserver = ' mvs18' /*Server host name */ sockval = DoSocket(' Terminate' ) /*Ensure clean interface*/ if actrace then say ' Terminate returned; ' sockval /*------------------------------------------------------------------*/ /* */ /* Initialize REXX socket interface */ /* and get our own TCP/IP Client id. */ /* */ /*------------------------------------------------------------------*/ sockval = DoSocket(' Initialize' , ' echorexx' ) if actrace then say ' Initialize returned: ' sockval if sockrc <> 0 then do say ' Socket initialize failed, rc=' sockrc say sockval exit(sockrc) end sockval = DoSocket(' Getclientid' ) if actrace then say ' Getclientid returned: ' sockval if sockrc <> 0 then do say ' Getclientid failed, rc=' sockrc say sockval exit(sockrc) end servipaddr = DoSocket(' Gethostbyname' , tpiserver) if actrace then say ' Gethostbyname returned: ' servipaddr if sockrc <> 0 then do say ' Gethostbyname failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end /*------------------------------------------------------------------*/ /* */ /* Get a socket to use for connection to the MISCSERV Server */ /* address space. */ /* */ /*------------------------------------------------------------------*/ sockdescr = DoSocket(' Socket' , ' AF_INET' , ' SOCK_STREAM' , ' TCP' ) if actrace then say ' Socket returned: ' sockdescr if sockrc <> 0 then do say ' Socket call for socket descriptor failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end /*------------------------------------------------------------------*/ /* */ /* Connect the socket to the MISCSERV Server */ /* */ /*------------------------------------------------------------------*/ name = ' AF_INET ' | | tpiport||' ' | | servipaddr sockval = DoSocket(' Connect' , sockdescr, name) if actrace then say ' Connect returned: ' sockdescr if sockrc <> 0 then do say ' Connect failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end /*------------------------------------------------------------------*/ /* */ /* Send the message to the MISCSERV server */ /* */ /*------------------------------------------------------------------*/ sockval = DoSocket(' Write' , sockdescr, record) if actrace then say ' Write returned: ' sockval if sockrc <> 0 then do say ' Write failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end /*------------------------------------------------------------------*/ /* */ /* Read the response from the MISCSERV Server */ /* */ /*------------------------------------------------------------------*/ if tpiport <> ' 9 ' then do respdata = DoSocket(' Read' , sockdescr) if actrace then say ' Read returned: ' respdata if sockrc <> 0 then do say ' Read failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end end /*------------------------------------------------------------------*/ /* */ /* Close the socket */ /* */ /*------------------------------------------------------------------*/ parse value respdata with resplen response sockval = DoSocket(' Close' , sockdescr) if actrace then say ' Close returned: ' sockval if sockrc <> 0 then do say ' Socket Close failed, rc=' sockrc say sockval x=Doclean exit(sockrc) end /*------------------------------------------------------------------*/ /* */ /* Terminate socket interface */ /* */ /*------------------------------------------------------------------*/ sockval = DoSocket(' Terminate' ) if actrace then say ' Terminate returned; ' sockval if sockrc <> 0 then do say ' Socket Close failed, rc=' sockrc say sockval exit(sockrc) end Exit(0) /*------------------------------------------------------------------*/ /* */ /* Doclean Procedure. */ /* */ /* If a socket call failed, and we are about to exit this */ /* Rexx application, close the socket and terminate the */ /* socket interface. */ /* */ /*------------------------------------------------------------------*/ Doclean: sockval = DoSocket(' Close' , sockdescr) sockval = DoSocket(' Terminate' ) return sockres /*------------------------------------------------------------------*/ /* */ /* DoSocket procedure. */ /* */ /* Do the actual socket call, and parse the return code. */ /* Return rest of string returned from socket call. */ /* */ /*------------------------------------------------------------------*/ DoSocket: 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) if actrace then do say ' Socket Parms=' a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 end else do msgstat = msg() z = msg("OFF") end Parse value ' SOCKET' ( a0,a1,a2,a3,a4,a5,a6,a7,a8,a9) with sockrc sockres if actrace then do say ' Socket return code=' sockrc end else do z = msg(msgstat) end return sockres |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours