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?
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? What is the definition of MSG16? What does #WTL do? Is it just a wrapper for WTO? > -----Original Message----- > From: IBM Mainframe Assembler List [mailto:ASSEMBLER- > [email protected]] On Behalf Of Yanick Jacques > Sent: Thursday, January 05, 2012 10:30 AM > To: [email protected] > Subject: How to display content of an address that point to a struct > > I'm avancing in my developpement,now i receive the pointers to the > HOSTENTD struct. Can someone can help me write the name of the hostname to > the log .How can I obtain the content of an address ex: H@NAME ? > > > HOSTENTD DSECT , > * > H@NAME DS A A(hostname) > H@ALIAS DS A A(zero-terminated array of aliases) > H@ADDRTY DS F Family of returned addresses > H@LENGTH DS F Length of returned addresses > H@ADDRLS DS A A(zero-terminated array of addresses) > * > HOSTENTL EQU *-HOSTENTD Length of HOSTENT main table > > Here's what I'm doing. > > #SOCKET GETHOSTBYADDR,IPADDR=HOSTIPA,IPADDRL=4, X > DOMAIN=AF@INET,HOSTENTP=(R2), X > RETCODE=RETCODE,ERRNO=ERRNO,RSNCODE=RSNCODE > LA R1,MSG15 DISPLAY GETHOSTBYADDR RESULTS > L R15,=A(DISRC) > BALR R14,R15 DISPLAY THE 3 RETURN CODES > CLC RETCODE,=F'0' GETHOSTBYADDR SUCCESSFUL? > BNE TCPCLOSE N. CLOSE SOCKET AND EXIT. > USING HOSTENTD,R2 > LA R6,H@NAME > ST R6,MYHOST > LA R1,MSG16 . > L R15,=A(DISLINE) > BALR R14,R15 > > DISLINE DS 0H > #SAVEREG SAVE THE CALLER'S REGISTERS > LR R12,R15 > USING DISLINE,R12 > LR R3,R1 GET PARM IN R3 > * > #WTL MSGID=M#999043,MSGDICT=NO,OVRIDES=OVRLOG, X > PARMS=((R3)),RGSV=(R2-R8) > * > #RESTREG RESTORE THE CALLER'S REGISTERS
