file reading

Reply
Contributor
Posts: 42

file reading

Hi ,

Can two or more sas (different) programs read one (same) file at the same time? if yes, then what is the statement/option that makes this possible ?


Thanks

Super User
Posts: 10,538

Re: file reading

Are you referring to using the same SAS dataset or accessing an external file such as a text file for input/output?

You probably need the SAS Share module if wanting to access SAS datasets.

Your environment may also make a difference. Are both programs running on the same physical computer? Accessing the file through a remote connection/ server? Operating systems?

Contributor
Posts: 42

Re: file reading

Hi,

I am refering to a file ( a mainframe file)   and not SAS dataset.   This file is only for reading and no write operation will or can happen to the file.

I acccess the file using below statements....

data data1;

infile "&dataset_name" Ftp Host='xxxxx' Port=xx USER='XXXX'  PASS='xxxxxxxxxxxxxxx' firstobs = 1 binary lrecl=3000 blocksize=32385 debug end=eof;

input   @0003 XXXXXXXXXXXXXXXX_ID        S370FZD4.0 @;

..................  ...........
..................  ...........

Now  suppose 2 different sas programs (one in mainframe and the other in unix) use this file for reading data...  and if they happen to access the file and start reading at the same time , then will it create any problem.   If yes, then is there any option to avoid that problem....?

The above is how UNIx SAS program will access the Mainframe file...

and below is how mainframe SAS program will access the  same file :

data DATAX1;

   infile FILN lrecl = 3000 firstobs = 1  truncover;

   attrib COL1   length = $19 informat = $ebcdic19.;

   attrib C02    length = $26 informat = $ebcdic26.;

   ......

   ......

   input @ 4 COL1  $ebcdic19.

         @ 23 COL2  $ebcdic26.

         ......

         ......

run;

Super User
Posts: 5,260

Re: file reading

I'm no mainframe specialist, but in most operating environments, there are no limits on how many read locks there may exist simultaneously. If you want to be 100% sure, discuss this with a Z/OS expert at your site.

Data never sleeps
Super User
Super User
Posts: 6,502

Re: file reading

Should not be an issue to READ the same file.  If it is a SAS dataset you might want to add the ACCESS=READONLY option to the libname statement to prevent anyone from trying to modify the file while others are reading it.

Ask a Question
Discussion stats
  • 4 replies
  • 300 views
  • 0 likes
  • 4 in conversation