Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 196915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:48:29+00:00 2026-05-11T16:48:29+00:00

I’m using SAS 9.2 on OpenVMS to connect to an external data source over

  • 0

I’m using SAS 9.2 on OpenVMS to connect to an external data source over a socket specifed with a filename statement:

filename extsrc SOCKET "extserver:port" recfm=v;

data foo;
infile extsrc;
input;
.... some statements to read stuff ...;
run;

This works (as it should) 99% of the time. However, once in a while the program that is supposed to be listening on the remote port isn’t. Currently this causes the program to exit with an error:

Error: Connection refused.

After which we try again, and it usually works. However, this is becoming tedious so I’d like to detect this error in the program and deal with it there. Does anybody know of a way to detect this type of error in SAS?

I’ve tried checking the validity of the fileref extsrc using the fileref() function, but that just returns -20005 , which means that the fileref is assigned but does not point to a local file (which is true). The error only becomes apparent when I use the fileref in a datastep, so I’d like to do something along the lines of:

data _null_;
rc=infile extsrc;
if rc=0 then do;
  //whatever I want to do;
end;
else do;
  //throw some error and try again later;
end;
run;

[update1]
I’m trying the suggestions done below, but in true heisenbug fashion the problem has failed to crop up over the last few days, so I’m not sure what the final solution is yet.
[/update1]

[update2]
The error finally cropped up again. As per cmjohns answer, the value of syserr is 1012 after this error occurs. I’ll now watch the value of syserr, and try again a fixed number of times if it fails.
[/update2]

[update3]
I’ve had some code up an running for a few days now that works. The additional problem was that (of course) if &syserr gets a value higher than 6 an error condition has occured, so depending on your errorabend/noerrorabend setting this causes the program to end completely, or it causes the program to continue with obs=0 in syntaxchek mode. Both are undesirable. The solution is to set options noerrorabend nosyntaxcheck before the datastep that produces this error. Additionally, if the error occurs I have to clear filename extsrc and reassign it. Finally, once this piece of code is complete I restore errorabend. If I restore nosyntaxcheck this causes SAS to detect the previous error condition and switch to syntaxcheck mode at that point which is also undesirable.
[/update3]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:48:29+00:00Added an answer on May 11, 2026 at 4:48 pm

    Have you tried testing the value of &syserr. Anything not 0 generally indicates a problem.

    You can see return values here. Judging by the list I’d guess a 1012 or 1020 is what you are getting during the socket error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 139k
  • Answers 139k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem with silverlight is penetration. The vast vast majority… May 12, 2026 at 7:47 am
  • Editorial Team
    Editorial Team added an answer Am sorry to have wasted everyone's time over this. The… May 12, 2026 at 7:47 am
  • Editorial Team
    Editorial Team added an answer You are most likely releasing something you shouldn't be, can't… May 12, 2026 at 7:47 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.