Then #SOCKET does NOT in fact load R2.  You need to load R2 with the address of 
some DS A before invoking #SOCKET.  After SOCKET returns, you need to load the 
contents of this DS A into R2 or your USING will be incorrect.

If you don't know how long the host name is, how can you expect to display it 
properly?  Is there some maximum length and it is padded with blanks if shorter?

It looks like you will have to make MSG16 much(?) larger and move the host name 
into it following the colon prior to invoking #WTL, probably before calling 
DISLINE.

> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-
> [email protected]] On Behalf Of Jacques, Yanick
> Sent: Thursday, January 05, 2012 1:26 PM
> To: [email protected]
> Subject: Re: How to display content of an address that point to a struct
>
> Does #SOCKET really load R2 for you?  (While not impossible, the syntax
> you used is more akin to using R2 as input rather than output.)  Or did
> you load it before invoking the macro?
>
> In the documentation, it say that the #Socket returns the address of a
> HOSTENT. In my case it's in R2.
>
> #SOCKET GETHOSTBYADDR,IPADDR=HOSTIPA,IPADDRL=4,               X
>         DOMAIN=AF@INET,HOSTENTP=(R2),                           X
>         RETCODE=RETCODE,ERRNO=ERRNO,RSNCODE=RSNCODE
>
> hostentp
>
> Specifies the name of a fullword field in which the system returns the
> address of a HOSTENT structure containing the information about the host.
>
> How is the field pointed to by H@NAME defined?  Is it a nul terminated
> array of characters (as in a C string) or length field followed by text
> (like many RACF parameters) or something else?
>
> The only thing I know is that H@NAME is the address of the hostname that I
> want to capture to write to the log.
>
> What is the definition of MSG16?
>
> MSG16    MSGTXT 'GETHOSTBYADDR HOSTNAME:'
>          MACRO
>
> &NAME   MSGTXT &TXT
>          LCLC &TMP
> &TMP     SETC '&SYSNDX'
> &NAME    DC AL1(L2&TMP)
> L1&TMP   DC C&TXT
> L2&TMP   EQU *-L1&TMP
>          MEND
>
> What does #WTL do?
>
> It's an IDMS macro to write to IDMS log

Reply via email to