HDTenEightyP/NetNews huggingface dataset:
Newsgroups: bit.listserv.sas-l
Date:         Thu, 17 Dec 1992 20:09:04 EST
Reply-To:     "Lawrence H. Muhlbaier" <lhm@BIOSTAT.MC.DUKE.EDU>
From:         "Lawrence H. Muhlbaier" <lhm@BIOSTAT.MC.DUKE.EDU>
Subject:      Summary: 'Concatenating' format libraries (Unix)
Comments: To: sas-l%vtvm2.BITNET@ncsuvm.ncsu.edu

This morning I asked:
>
> For SAS 6.07 on SunOS 4.1.1 (Unix).
>
> I would like to be able to concatenate format libraries in the
> Unix environment.  Can it be done?  If so, how?
>

My thanks to all who responded.  I received one brute-force response from
tvenet@aidsun.med.miami.edu (Theodore Venet - Biostat):

> how about converting the format library (or libraries) to
> datasets (read the manual wrt contlout option I think) and doing
> your concatenating when they're in their dataset state, follow
> this up with contlin (I think) option from the proc format
> (read up on this in the proc dataset chapter) option to
> re-convert the synthesized dataset into its library counterpart.

This will work, and I can write a macro to implement it.

Several people responded with a reference to P-222 (p. 91) for the
FMTSEARCH option.  This response will help me in the next release of
SAS.  Unfortunately, P-222 is for versions of SAS after the Unix ones
(MVS/CMS/VMS) and is not available on Sun's SAS 6.07.  Note:  nowhere
in P-222 does it state this.  The only place I have seen it written is
in the cover letter that came with the manual in my subscription
service, confirmed by a later call to SAS Tech Support (I do feel sorry
for SAS Tech Support on this one; I can't imagine how many calls this
omission to the documentation has caused.).

So, I may wait until 6.09 next summer...

Lawrence H. ('Doc') Muhlbaier           muhlb001@mc.duke.edu
Assistant Research Professor            muhlb001@dukemc
Duke University Medical Center          919-286-8830 (office)
DUMC 3865                               919-286-9534 (home)
Durham, NC 27710-7510                   919-286-2947 (FAX)
From: CCEWWM@NUSVM.BITNET (Wong Wui-Ming)
Newsgroups: bit.listserv.sas-l
Subject: SORT DUPLICATES
Date: 16 Dec 92 13:03:11 GMT
Reply-To: Wong Wui-Ming <CCEWWM@NUSVM.BITNET>
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU

Try adding NOEQUALS to NODUPLICATES option in PROC SORT to remove
duplicate observations i.e. observations where every variable values
are equal.

Wong Wui-Ming
Systems Programmer
Computer Centre
National University of Singapore
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Sat, 19 Dec 1992 15:00:00 PST
Reply-To:     Melvin Klassen <KLASSEN@UVVM.BITNET>
Comments:     Warning -- original Sender: tag was NETNEWS@UVVM.UVIC.CA
From:         Melvin Klassen <KLASSEN@UVVM.BITNET>
Subject:      Re: Where is Gotham City?

Helge.Niska@dafa.se>, Helge Niska <Helge.Niska@DAFA.SE> writes:
> I am owner of the list LANTRA-L@FINHUTC. Lately error messges like the one
> below keep coming. As you can see, there is no such subscriber on the list.
> We do have one RBUEKER@MEDICS.JSC.NASA.GOV. How can that address
> get the form quoted in the error message from MEDICS???
> What shall I do - I don't want those messages to keep coming.

Richard Bueker <RBUEKER@MEDICS.JSC.NASA.GOV> has established E-mail
"forward"-ing to the ID <RBUEKER@GothamCity.JSC.NASA.GOV>.
Unfortunately, his ID on that machine is 'BUEKER'.

So, just remove his ID from your mailing-list,
and contact <postmaster@MEDICS.JSC.NASA.GOV>,
and tell him/her about Richard's incorrect E-mail "forward"-ing.

P.S. Questions like this should be sent to the 'LSTOWN-L@INDYCMS'
     (LISTSERV list-owners) mailing list.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Thu, 17 Dec 1992 11:01:00 EST
Reply-To:     Cande V Ananth <ANANTH@UNC.BITNET>
From:         Cande V Ananth <ANANTH@UNC.BITNET>
Subject:      Re : POWER calculations for Multivariate GLM's

SAS_L'ers,

##  This is a followup to my earlier posting regarding the
    availability of the SAS IML (macro) to do POWER analysis
    for multivariate linear models with repeated measures.
    I just met Dr Keith Muller, and he suggested that persons
    interested in the macro should write to either of the two
    address :

    1.  e-mail :    POWER.FPG@MHS.UNC.EDU

    2.  Statistical Power Software
        Design and Statistics Unit
        Frank Porter Graham Child Dev Center
        CB #8180, University of North Carolina
        Chapel Hill 27599

##  Addendum to my earlier mail :

         PLEASE DO NOT CALL Dr Keith Muller for the SAS code.

##  Interested persons may look up the following article that
    appeared in JASA, December issue, on power analysis, by
    Muller et al. The reference is :

    Muller KE, LaVange LM, Ramey SL, Ramey CT. "Power
      calculations for general linear multivariate models
      including repeated measures applications".
      Journal of the American Statistical Association
      87 : 1209-1226, 1992.

##  Hope this information helps.

... Cande V Ananth  (ananth@UNC.bitnet)
    Department of Biostatistics, SPH
    TheUniversity of North Carolina
    Chapel Hill NC 27599-7400
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Thu, 17 Dec 1992 10:18:03 EST
Reply-To:     "Lawrence H. Muhlbaier" <lhm@BIOSTAT.MC.DUKE.EDU>
From:         "Lawrence H. Muhlbaier" <lhm@BIOSTAT.MC.DUKE.EDU>
Subject:      'Concatenating' format libraries (Unix)
Comments: To: sas-l%vtvm2.BITNET@ncsuvm.ncsu.edu

For SAS 6.07 on SunOS 4.1.1 (Unix).

I would like to be able to concatenate format libraries in the
Unix environment.  Can it be done?  If so, how?

I want to do this so that in cooperative projects, we can have a
common library for system-wide formats and personal libraries for
individual needs or to over-ride the system-wide formats.  I don't
want to open the system format library to all users because of
the possibility of inadvertent over-writes of formats.

I used to do it under MVS by using the JCL capability:

//LIBRARY DD DSN=A,...
//        DD DSN=B,...

and this works for version 5 and 6.  I would like to be able to have
the same capability in SAS under Unix (and DOS or PC-Windows,
for that matter).

Have I missed something in the FM?  Is there a work-around?

Thanks in advance,
Doc Muhlbaier
--------
Lawrence H. ('Doc') Muhlbaier           muhlb001@mc.duke.edu
Assistant Research Professor            muhlb001@dukemc
Duke University Medical Center          919-286-8830 (office)
DUMC 3865                               919-286-9534 (home)
Durham, NC 27710-7510                   919-286-2947 (FAX)
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
X-Mailer: ELM [version 2.4dev PL65]
Mime-Version: 1.0
Content-Type: text
Content-Length: 224
Newsgroups: bit.listserv.sas-l
Date:         Thu, 17 Dec 1992 17:05:42 EST
Reply-To:     Paul Dalberth <Paul.Dalberth@LAMBADA.OIT.UNC.EDU>
From:         Paul Dalberth <Paul.Dalberth@LAMBADA.OIT.UNC.EDU>
Subject:      Concatenating format libraries
Comments: To: SAS-L@uga.cc.uga.edu

In response to L. Muhlbaier's question about format libraries:

In version 6.07, the fmtsearch system option allows specification of a
search path for format libraries.  It's documented on page 91 of
technical report p-222.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Return-Path: <ecooch@sas.upenn.edu>
Posted-Date: Mon, 14 Dec 92 15:33:11 EST
X-Mailer: ELM [version 2.3 PL11-upenn1.8]
Newsgroups: bit.listserv.sas-l
Date:         Mon, 14 Dec 1992 15:33:11 EST
Reply-To:     Evan Cooch <ecooch@SAS.UPENN.EDU>
From:         Evan Cooch <ecooch@SAS.UPENN.EDU>
Subject:      outputting design matrix
Comments: To: sas-l%marist.bitnet@cunyvm.cuny.edu

Greetings all...

As part of a biometrics class, we'd like to be able to demonstrate the
relationship between the classical use of dummy variables, and how SAS
PROC GLM parameterizes the design matrix (pp. 928-9931 in the 2nd volume
of the STATS manual).

  Is there any opption that outputs the design matrix (I can't find one).
I suspect there is away to go from the estimable functions to this matrix,
but I am hoping for something simpler.

Thanks in advance...




           _///_              +----------------------------+
           -. .-              |       Evan G. Cooch        |
           ( L )    \////     |   Department of Biology    |
         --(\=/)--  (   )     | University of Pennsylvania |
        /         \ /  /      | Philadelphia, Pennsylvania |
        I          V  /       |   Phone: (215) 898-7129    |
        I            /        |     FAX: (215) 898-8780    |
        I           /         | ECOOCH@MAIL.SAS.UPENN.EDU  |
                              +----------------------------+
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Encoding: 5 TEXT
X-Mailer: Microsoft Mail V3.0 (beta-2)
Newsgroups: bit.listserv.sas-l
Date:         Tue, 15 Dec 1992 09:48:00 EST
Reply-To:     PXG6@ATSDHS2.EM.CDC.GOV
From:         PXG6@ATSDHS2.EM.CDC.GOV
Subject:      SAS+SyncSort
Comments: To: SAS-L@uga.cc.uga.edu

Mike , Could you please send me a copy of your Sync-sort guide.  Thank you,

                                   Phil Graffunder
                                   ATSDR/DHE/EDRB
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Full-Name: Kevin Nechodom (Unix Wannabe)
Organization: U of U CSSRD/STACC
Plan: To get a CS degree before I die.
Censored-By: UofU Thought Police
Mailer: Elm [revision: 70.30]
Newsgroups: bit.listserv.sas-l
Date:         Wed, 16 Dec 1992 15:29:02 MST
Reply-To:     knechod@stacc.med.utah.edu
From:         "Kevin Nechodom (Unix Wannabe)" <knechod@STACC.MED.UTAH.EDU>
Subject:      Multi-line INPUT formatting
Comments: To: SAS Mailing List <sas-l@uga.cc.uga.edu>

SAS-folks!

I am looking at methods of reading a data file with multiple and
variable numbers of records per case.  I have 3 fields that uniquely
identify a case, and 1 field that uniquely identifies a record within
that case.  Each case has a different input format.

I have read that INPUT can read from multiple records for a single
case, but it appears that you have to know the number of records ahead
of time.  Is that true?

Thanks muchly!

--
Kevin Nechodom UofU STACC    | If you believe that only one choice is NO choice
knechod@stacc.med.utah.edu   | or you are facing that one choice, call The
 Any opinion expressed here  | Nurturing Network.  1-800-TNN-4MOM.  Defend both
 is my responsibility alone. | life and choice.  An alternative to abortion.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Mon, 14 Dec 1992 17:17:17 PST
Reply-To:     Melvin Klassen <KLASSEN@UVVM.BITNET>
Comments:     Warning -- original Sender: tag was NETNEWS@UVVM.UVIC.CA
From:         Melvin Klassen <KLASSEN@UVVM.BITNET>
Subject:      Re: Kappa

"Dr. Avi Kluger" <kluger@GANDALF.RUTGERS.EDU> says:
>I would appreciate a SAS code for kappa (e.g., Siegel, 1988)
>Is it available anywhere?

If you're running the VM/CMS version of Version 6 of SAS,
look at the member 'CATKAPPA' in the 'SASSTAT MACLIB' file,
which resides on the same mini-disk as the SAS/STAT software.

*----------------------------------------------------------------*
|  FROM: LANDIS AND KOCH (1977)                                  |
|  ILLUSTRATE: REPEATED MEASURES, KAPPA STATISTIC COMPUTATION    |
*----------------------------------------------------------------*;
From: multiple@MSHRI.UTORONTO.CA
Newsgroups: bit.listserv.sas-l
Subject: PROC CPORT and PROC CIMPORT
Date: 18 Dec 92 15:25:57 GMT
Reply-To: multiple@MSHRI.UTORONTO.CA
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Comments: To: sas-l@vtvm2.cc.vt.edu@grind.utcs.utoronto.ca

Hi SAS-users:

I have a problem on transporting a SAS dataset from VMS to MS-DOS.
I am running under 6.04 in VMS and 6.07 in MS-DOS.

The program code in VAX is like this:

LIBNAME vaxlib '[multiple.final3.saslib]';
FILENAME trands 'ds.trn';
PROC CPORT DATA=vaxlib.vmsdata FILE=trands MEMTYPE=DATA;

After I copied the tranport file, 'ds.trn', I run the CIMPORT program.

The program code in PC is:
LIBNAME pclib 'e:\sas';
FILENAME trands 'e:\sas\ds.trn';
PROC CIMPORT LIB=pclib INFILE=trands;

Somehow, it doesn't work on the second program.
Here is the LOG file:

NOTE: Proc CIMPORT begins to create/update catalog ELIB.L
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.B
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.TROL
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.Y
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.
NOTE: Total number of entries processed: 0

NOTE: Proc CIMPORT begins to create/update catalog ELIB.
ERROR: Cannot rename output data set ELIB. .CATALOG.
       File name: E:\SAS\ .SCT.
       Temporary name: E:\SAS\#TF0000F.SCT.
ERROR: Unable to open catalog ELIB.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The PROCEDURE CIMPORT used 7.00 seconds.
NOTE: SAS Institute Inc., SAS Circle, PO Box 8000, Cary, NC 27512-8000


If there is any suggestion please send forward to
"multiple@mshri.utoronto.ca"
Thank you in advance.

Kenneth Kwok
Mount Sinai Hosp. Research Institute
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Wed, 16 Dec 1992 11:40:34 EST
Reply-To:     Andy Norton <76350.1604@COMPUSERVE.COM>
From:         Andy Norton <76350.1604@COMPUSERVE.COM>
Subject:      Re: PROC SORT NODUPLICATES is no good
Comments: To: SAS-L <SAS-L@AWIIMC12.IMC.UNIVIE.AC.AT>

----------------------------------------------------------------------
CONTENT:   Response
SUMMARY:   Derek Morgan has identified a special case in which
           PROC SORT NODUPLICATES makes sense.
REL/PLTF:  6.07.0304/CMS, 6.04/PC-DOS, beta 6.08/OS2
E-ADDR:    76350.1604@compuserve.com
NAME:      Andy Norton
ADDRESS:   Trilogy Consulting, 5228 Lovers Lane, Kalamazoo MI 49002 USA
PHONE:     (616) 344-2191
----------------------------------------------------------------------

Derek Morgan responded to me:

Andy
>I suppose that some data source could generate
> duplicates in such a way that they were always adjacent, so there is
> no need to sort.  Is this what you are dealing with?
>

Derek
> Yes. In fact, I frequently need to obtain values from a previous
> data point on a given subject, so during the merge process, the data
> wind up being adjacent.

I agree that Derek has identified a special case in which NODUPLICATES
not only works but is superior to NODUPKEY.  If you have exactly two
datasets and interleave the observations by the BY variables,
NODUPLICATES can be used to remove exact duplicates while NODUPKEY
would remove all duplicates.  Additional sorting (BY _ALL_) is
unnecessary because if there can be no more than two observations per
BY group, any exact duplicates must be adjacent.

Thanks, Derek.  I should rephrase my statement to:
  "NODUPLICATES is no good if you can possibly have multiple
duplicates."

I wish this was more forcefully emphasized in the Language Reference. I
still think the Usage book on this topic is bad advice (page 157):
   "The NODUPLICATES option in the SORT procedure deletes any
    observation that duplicates the values of all variables (both BY
    variables and other variables) of another observation in the data
    set."
The terms "any" and "another" certainly don't draw attention to the
need for duplicates to be adjacent.

Andy
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Tue, 15 Dec 1992 17:02:12 -0600
Reply-To:     "Richard W. Cole" <rcole@CCWF.CC.UTEXAS.EDU>
From:         "Richard W. Cole" <rcole@CCWF.CC.UTEXAS.EDU>
Subject:      multivariate power code in SAS needed
Comments: To: sas-l%uga.BITNET@ricevm1.rice.edu

Can anyone send some code or text for calculating power for multivariate
designs using SAS.  I think there were some SUGI papers on the topic in
1986 at the international conference but I don't have access...

Thanks for your time and hopefully your code...


========================================================
Richard Cole, Stat/Math Services         Learning to
Computation Center UT Austin TX, 78712   Paint by
rcole@ccwf.cc.utexas.edu                 Numbers
========================================================
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Wed, 16 Dec 1992 15:33:49 CST
Reply-To:     LISA KRIESE <ANSC413@UNLVM.BITNET>
From:         LISA KRIESE <ANSC413@UNLVM.BITNET>
Subject:      merging 2 datasets solved

contents: merging 2 datasets solved
platform: tso/mvs
version: sas 6.07

    Many, many thanks to all who answered my question on why

          merge one(in=a) two(in=b); by cow; if a&b;

didn't work on my system.  SAS thinks the &b is a macro command.  All
I did was replace a&b with a and b and it worked fine.  Thanks again.

Lisa Kriese
ARS-USDA Meat Animal Research Center
ansc413@unlvm
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Return-Path: <derek@wubios>
X-Mailer: ELM [version 2.3 PL11]
Newsgroups: bit.listserv.sas-l
Date:         Tue, 15 Dec 1992 13:49:10 CST
Reply-To:     Derek Morgan <derek@WUBIOS.WUSTL.EDU>
From:         Derek Morgan <derek@WUBIOS.WUSTL.EDU>
Subject:      Re: PROC SORT NODUPLICATES is no good
Comments: To: 76350.1604%COMPUSERVE.COM@OHSTVMA.ACS.OHIO-STATE.EDU
Comments: cc: SAS Mailing List <SAS-L@ohstvma.ircc.ohio-state.edu>

> So, NODUPLICATES only eliminates duplicates if they occur next to each
> other.  To get them next to each other, sort by all the variables.  But
> then you might as well use NODUPKEY right away:
>    proc sort data=TEST out=TEST2 nodupkey;
>      by _all_;
>    run;
> or alternatively
>    proc sql;
>      create table TEST2 as
>        select distinct
>               *
>        from   TEST;
>    quit;
> By the way, neither approach works if you have "too many" variables.
> The limit on CMS appears to be a maximum of 127 variables.
>
> I've got two questions:
>    1)  Is there any legitimate use of NODUPLICATES?
>        I suspect not.  My SAS 82 manual shows NODUPLICATES but not
> NODUPKEY.  My theory is that NODUPLICATES remains for compatibility,
> but NODUPKEY should always be used instead.
>

  Yes, there is. For example, take a dataset of events that is sorted by
  ID, LOCATION, and EVNTDATE. What about multiple occurences on the same day?
  It is not possible to obtain event times, and the data associated with the
  event will be different. It would be possible to sort by _ALL_ of the
  variables using NODUPKEY in your first example, but there's always the
  possiblility of leaving a variable off of the BY statement if the variables
  aren't ordered in the dataset structure according to the desired sort order.

  It would be a pretty useless exercise to sort this particular information
  by descriptive variables over identifying variables. One doesn't always have
  control over dataset construction, nor time to redo it correctly.

  NODUPLICATES under UNIX 6.07 has functioned well for me.

  Derek Morgan
  Washington University
  Division of Biostatistics
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Tue, 15 Dec 1992 16:21:40 PST
Reply-To:     "P. Oldenkamp 5-4481" <oldenkmp@ESPRESSO.RT.CS.BOEING.COM>
From:         "P. Oldenkamp 5-4481" <oldenkmp@ESPRESSO.RT.CS.BOEING.COM>
Subject:      Re: PROC SORT NODUPLICATES is no good
Comments: To: SAS-L@uga.cc.uga.edu, 76350.1604@COMPUSERVE.COM

----------------------------------------------------------------------
CONTENT:  COMMENT
REL/PLTF: 6.07TS203/SunOS 6.07/MVS 6.07/CMS 6.04/PC-DOS
E-ADDR:   oldenkmp@ESPRESSO.boeing.com
NAME:     Paul OldenKamp
PHONE:    206-865-4481
----------------------------------------------------------------------
Andy Norton said,

> I've got two questions:
>    1)  Is there any legitimate use of NODUPLICATES?
>        I suspect not.  My SAS 82 manual shows NODUPLICATES but not
> NODUPKEY.  My theory is that NODUPLICATES remains for compatibility,
> but NODUPKEY should always be used instead.

Thanks for pointing this out Andy, I've been spending the day correcting my
production programs so they will actually eliminate the records I don't want.

As I recall, version 5.x had the option NODUP(LICATES) but not NODUPKEY.
Version 6.03(6.04) only has the NODUPKEY option and I think the NODUP was
added back into version 6.06 in response to complaints.  Was it done
differently than in version 5?

My question is how does Andy's example work in version 5 and does it depend
any on the type of sort used(DFSORT, Syncsort, or SAS sort)?  I got the
same result Andy got in 6.07 for SunOS using SAS sort.

Derek Morgan says that there is a use for NODUP but I don't understand his
example.  How about some SAS code showing a counter example to Andy's?

----------------------------------------------------------------------
               //  Paul OldenKamp
              //   BCS Research and Technology          .
             //    P. O. Box 24346, MS 7L-21            |\
            //     Seattle, WA   98124-0346             | \____oo_
           //==========================================((__|  /___>
          //       ___ ___ ___ ___     __                  | //
         //       /__//  //__  /  /\ //  _                 |//
        //       /__//__//__ _/_ /  //__/                  ''
       //
From: hilda@WILPAT.WILPATERSON.EDU (HILDA SPAGNA)
Newsgroups: bit.listserv.sas-l
Subject: SOLVED ZCLEANUP PROBLEM
Date: 16 Dec 92 13:26:13 GMT
Reply-To: hilda@wilpat.wilpaterson.edu
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
X-Vms-To: SMTP%"@NJIN:SAS-L@OHSTVMA.BITNET"
X-Vms-Cc: HILDA
Comments: To: OHSTVMA.BITNET@pilot.njin.net


    We have had mail problems, so evidently some people did not
    get my SOLUTION TO ZCLEANUP.

    WPC's problem was that ZCLEANUP was the same as it was in version 5.
    6.07 was just implemented.

    key = z%%%%%%%%  should have been changed to key = SAS$WORK%%%%%%%%
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Fri, 11 Dec 1992 13:03:41 -0500
Reply-To:     jack.hamilton@AMAIL.AMDAHL.COM
From:         jack.hamilton@AMAIL.AMDAHL.COM
Subject:      Macro code to test file existance under MVS and CMS
Comments: To: apple!ohstvma.bitnet!sas-l@juts.ccc.amdahl.com

sparapan@SALT.RA.ANL.GOV wrote:

> I'm sorry if this has been handled better by someone else, but
> the question about the existence of files got me thinking and
> then an application required me do something about it.  Since,
> we are using SAS 6.07 under SunOS(Unix), this is operating
> system dependent.  However, I found that it was poorly
> documented and after much trial and error I arrived at the
> following code-segment solution.  I also test if the
> directory exists before I do a "libname".  This segment should
> be included in a macro since you cannot use the macro language
> outside of a macro(not yet, but in 6.09 right?).
>
> Rodney
> _______________________________________________________________
> x "test -d &base";
> run;
> %if &sysrc~=0 %then %do;
>         x "mkdir -p &base";
>         run;
> %end;
> libname _&data "&base";
> x "test -f &base/datafile";
> run;
> %if &sysrc=0 %then %do;
>         something appropriate for an existing file
> %end;
> %else %do;
>         something that would be appropriate if the
>         file does not exist
> %end;

You can do something similar under CMS with the STATE/ESTATE/STATEW/ESTATEW
family of commands, or under MVS with the LISTDS command.  In both cases,
errors produce screen output, so you would probably want to write a little
REXX wrapper to suppress it.

There are several operating system commands which can be done in SAS but might
be a little simpler using the approach above.  DELETE and COPY come to mind.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU