Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Cobol EZASOKET call to SETSOCKOPT fails

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 31
Location: Karlsruhe / Germany

PostPosted: Thu Oct 06, 2016 7:12 pm    Post subject: Cobol EZASOKET call to SETSOCKOPT fails
Reply with quote

hello,

I try to set an Socket timout for recv using EZASOKET with SETSOCKOPT SO_RCVTIMEO:

https://www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.halc001/csetopt.htm

Code:
00122         01 .                                                     
00123            05  EZA-FUNCTION            PIC X(16).               
00124            05  EZA-ERRNO               PIC S9(8) BINARY.         
00125            05  EZA-RETCODE             PIC S9(8) BINARY.         
00140 AS_014     05  EZA-OPTNAME             PIC 9(8)  BINARY.         
00141 AS_014     05  EZA-OPTVAL.                                       
00142 AS_014         10 EZA-OPTVAL-SEC       PIC 9(16)  BINARY.         
00143 AS_014         10 FILLER               PIC 9(8)  BINARY VALUE 0.
00144 AS_014        10 EZA-OPTVAL-USEC      PIC 9(8)  BINARY VALUE 0.
00145 AS_014     05  EZA-OPTLEN              PIC 9(8)  BINARY.         


Code:
00770 AS_014     MOVE 'SETSOCKOPT'         TO EZA-FUNCTION           
00771 AS_014     MOVE 4102                 TO EZA-OPTNAME           
00772 AS_014     MOVE 30                   TO EZA-OPTVAL-SEC         
00773 AS_014     MOVE LENGTH OF EZA-OPTVAL TO EZA-OPTLEN             
00779 AS_014     CALL  'EZASOKET' USING      EZA-FUNCTION           
00780 AS_014                                 EZA-S                   
00781 AS_014                                 EZA-OPTNAME             
00782 AS_014                                 EZA-OPTVAL             
00783 AS_014                                 EZA-OPTLEN             
00784 AS_014                                 EZA-ERRNO EZA-RETCODE   
00785 AS_014     IF EZA-RETCODE NEGATIVE THEN                       
00786 AS_014          GO TO ERROR-IN-SOKET                           
00787 AS_014     END-IF                                             


I want a timeout of 30 seconds. But always get the error 180. But I can not find any description about this error.

I think my EZA-OPTVAL declaration is wrong.

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_1.13.0/com.ibm.zos.r13.halc001/cgetopt.htm#optname
Quote:
This option requires a TIMEVAL structure, which is defined in SYS1.MACLIB( BPXYRLIM) macro. The TIMEVAL structure contains the number of seconds and microseconds specified as fullword binary numbers. The seconds can be a value in the range 0 - 2 678 400 (equal to 31 days), and the microseconds can be a value in the range 0 - 1 000 000 (equal to 1 second). Although TIMEVAL value can be specified using microsecond granularity, the internal TCP/IP timers that are used to implement this function have a granularity of approximately 100 milliseconds.


This BPXYRLIM I found here:
http://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r1.bpxb100/yrlim64.htm

Hope somebody can help...[/code]
Back to top
View user's profile Send private message

Andi1982

New User


Joined: 27 Mar 2008
Posts: 31
Location: Karlsruhe / Germany

PostPosted: Thu Oct 06, 2016 8:03 pm    Post subject:
Reply with quote

I get error no 10180 which means:

Quote:
The parameter list for a SETSOCKOPT call is incorrect.


My output field for error number was to short...

But still i can not find out what exactly is the problem.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Oct 06, 2016 10:20 pm    Post subject:
Reply with quote

The link you have in your post specifically has OPTVAL as PIC 9(8) BINARY -- which is far different from what you have. If you don't define the variables as they are in the manual, don't expect zero return codes.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 31
Location: Karlsruhe / Germany

PostPosted: Fri Oct 07, 2016 11:17 am    Post subject:
Reply with quote

I also tried with OPTVAL PIC9(8) or course. I think i tried nearly all declarations of OPTVAL.

I did this delaration above because it was written that
Quote:
This option requires a TIMEVAL structure, which is defined in SYS1.MACLIB( BPXYRLIM) macro. The TIMEVAL structure contains the number of seconds and microseconds specified ...


This structure I found here http://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb100/yrlim64.htm

Code:
TIMEVAL              DSECT ,      Timeval structure                             
TMVL_SEC             DS    FD     Seconds                                       
                     DS    F      Padding                                       
TMVL_USEC            DS    F      Microseconds                                 
TIMEVAL#LENGTH       EQU *-TIMEVAL Length of this DSECT
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 07, 2016 12:46 pm    Post subject: Reply to: Cobol EZASOKET call to SETSOCKOPT fails
Reply with quote

The TIMEVAL structure is used by an entirely different function.

You need to pass exactly what is described in your first link.

I doubt that it matters, but why did you make some of them signed? You don't show EZA-S, which contains the socket number you are interested in.

You are collecting information to do the GET, you are not doing the GET.
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 31
Location: Karlsruhe / Germany

PostPosted: Fri Oct 07, 2016 1:03 pm    Post subject:
Reply with quote

Yes you are right, I also played around with signed and unsigned. I am using EZA-S and some of the other fields also for the other EZASOKET calls and they are working fine.

The SO_LINGER, RECVTIMEO are exceptions where you do not have to pass an integer. And then you also have to set the length to an different value than integer length.

But I start to believe that our system z/VSE 5.1 does not support this option to set a socket timeout. Maybe thats the reason why it is not working.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 07, 2016 1:53 pm    Post subject: Reply to: Cobol EZASOKET call to SETSOCKOPT fails
Reply with quote

IBM z/VSE, z/VSE TCP/IP Support, Version 5 Release 1
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us