1

I am trying something in C on hp-nonstop(tandem), As part my task is to wait for sometime.

I try to use the

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main()
{
   int i;
   for(i=0;i<10;i++)
   {
     printf("Something");
     sleep(5);
     printf("Something");
     fflush(stdout);
    }
 }

It's compiling without any problem,

While running it is giving ABENDED: each time different no.

Loki
  • 1,180
  • 9
  • 13
  • Is there a specific ABEND code/extra information that you're getting? – Thomas Jager Sep 25 '21 at 12:27
  • sleep() always succeeds, so there is no failure return. **An abend is generated when any failures are encountered that prevent this function from completing successfully.** – alinsoar Sep 25 '21 at 12:46
  • https://support.novell.com/techcenter/articles/ana19950604.html – alinsoar Sep 25 '21 at 12:47
  • I think you need to provide more detail, otherwise it is impossible for anybody to say why "ABnormal END" occurred. – alinsoar Sep 25 '21 at 12:49
  • I have added the code, which I am trying and abend no. Can you please tell me what information more you need ? @alinsoar – Loki Sep 25 '21 at 17:41
  • `#include ` won't compile. Please post your actual code. – Andrew Henle Sep 25 '21 at 17:48
  • It depends on the version of the non-stop series @AndrewHenle Please go through the hp nonstop manuals once! If I remove the sleep() function it works! For example, http://nonstoptools.com/manuals/SqlMp-C-Reference.pdf Page no. 221 – Loki Sep 25 '21 at 17:51

1 Answers1

3

The result calling sleep() from guardian environment is undefined. That might be leading to ABEND that you mentioned. If you want to wait for some time in guardian hp-nonstop environment, you should call DELAY(). It takes centi-seconds as arguments. So if you want to add delay of 5 seconds, you should call it as DELAY (500). You also need to include the header #include<cextdecs(DELAY)>

Pras
  • 4,047
  • 10
  • 20