HDTenEightyP/NetNews huggingface dataset:
From: mford@news.weeg.uiowa.edu (Mark Ford)
Subject: SAS/AF Locate command and indexes
Organization: University of Iowa, Iowa City, IA, USA
Distribution: usa
Date: Mon, 27 Jul 1992 21:05:50 GMT

I am working on a SAS/AF application under the VMS SAS606 environment.
My application uses the LOCATEC command to search a SAS data set for a match
of the given variable.  (In this case an ID code).  To make the search faster
I would like to use the binary search method.  The data set is also indexed
on the ID code.  Can I use the LOCATEC binary search on the indexed variable 
without having to sort the data set after any adds or deletes?  I have had
trouble doing this.  After adding an observation I had to sort the data set for
the LOCATEC command to find that observation.  Should the index do this or
does the SAS index only work with WHERE and BY clauses?

Thank you.
Mark Ford.
mford@umaxc.weeg.uiowa.edu

Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Fri, 31 Jul 1992 13:28:47 -0500
Reply-To:     Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
From:         Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
Subject:      RE: more on nesting data steps
Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
Comments: cc: GIBES@tin.monsanto.com

 CONTENT:   Response (to "more on nesting data steps")
 SUMMARY:   Try SET ... POINT= for all possible pairs in a data step
 REL/PLTF:  n.a.
 E-ADDR:    gibes@swirl.monsanto.com
 NAME:      Kernon Gibes
 PHONE:     (708) 506-2873
 DATE:      31 July 1992

 I'm going to take a crack at the two postings on "concurrent sas data
 steps" and "more on nesting data steps".  No flames please.  I fully
 realize that I'm doing some MAJOR guessing here.  My intent is not so
 much to answer the question as to provoke further clarification.  (I
 don't know who the requestor is).

 ASSUMING that all your data is actually in a data set called RAW with
 variables VAR1 to VAR&P (&P = 3 below) and one observation per person
 and ASSUMING that the summary statistics computed for the i-th person
 by all others can be computed without IML code, then a rough sketch of
 an approach using the data set POINT is outlined below.  Of course, the
 later assumption is, I think, quite crucial.  I'm presuming that the
 requestor can either see how to generalize the fake stats I'm doing or
 see why this approach won't work and explain futher requirements.

 /*** define a macro needed for the data step ***/
 %macro rename;
  RENAME=(
    %do i = 1 %to &p;
      var&i = _var&i
    %end;
   )
 %mend rename;

 %let P=3;

 data stats;
  array vector_i {*} var1-var&p;
  array vector_j {*} _var1-_var&p;

  do i=1 to N;
     /*** do summary stats for i, over N-1 pairings
          (zero out i-th summary stats) ***/
     sumcp = 0;
     ssqcp = 0;
     do j=1 to N;
      if i ne j then do;
         /*** load in data for i-th person ***/
        set raw nobs=N point=i;
        outid =id;
         /*** load in data for j-th person ***/
        set raw( %rename ) point=j;
         /*** do summary stats for i, j data pairing
              (zero out summary stats for P by P computations) ***/
        cp = 0;
        do k = 1 to &p;
           cp = cp + vector_i[k] * vector_j[k];
        end;
         /*** do summary stats for N-1 pairings with the i-th person**/
        sumcp = sumcp + cp;
        ssqcp = ssqcp + cp*cp;
      end;
     end;
     output;  /*** only need global stats for each person ***/
  end;
  stop;  /*** VERY necessary ***/
 keep outid var1-var&p sumcp ssqcp;
 run;
Newsgroups: bit.listserv.sas-l
From: a587700@hp9000.csc.cuhk.hk (Frank Ng)
Subject: SAS System Resources Control
Organization: The Chinese University of Hong Kong
Date: Fri, 24 Jul 1992 10:31:27 GMT


Dear Netters,

	I am working for an academic computing system project which involves
the application SAS 6.07. This application will run on an HP9000/750 
application server, while an HP9000/817S will serve as a file server.
For the client part, we have 24 X-Window systems (on PCs and Mac.)
and other VT100 emulated terminals on our LAN. 

	As you may know, the above application will eat a lot of CPU
time and memory space, generate a lot of disk activities and processes, etc..

	As I think the system resources control should be implemented in order
to fairly distribute the resources to users, may I ask for your
suggestions/comments to tackle the following potential problems. 
	
   1). Maximum CPU time allowed for a single user/process interactively 

   2). Maximum memory usage allowed for a single user/process interactively 

   3). Maximum file size created by user under a file system at any time

  If you think other potential problems may affect our system, please 
kindly let me know as well.
	
    Thanks a lot in advance.

.Frank NG

Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
X-Acknowledge-To: <CASSELL@UNCVM1>
Newsgroups: bit.listserv.sas-l
Date:         Tue, 28 Jul 1992 12:25:10 EDT
Reply-To:     Jim Cassell <CASSELL@UNCVM1.OIT.UNC.EDU>
From:         Jim Cassell <CASSELL@UNCVM1.OIT.UNC.EDU>
Subject:      Re: Asking about OS/2 list
Comments: To: "SAS(r) Discussion" <SAS-L@VTVM2.CC.VT.EDU>
              28 Jul 1992 12:02:00 EST from <UABC%UNC.BITNET@VTVM2.CC.VT.EDU>

On Tue, 28 Jul 1992 12:02:00 EST A. Barrios said:
>I would appreciate if some of you know about a discussion
>list for OS/2 users and could give me directions to subscribe
>it.
>
I found two in the "list of lists"

  OS2@BLEKUL11  - Moderated Disucssion Forum on OS/2
  OS2-L@FRORS12 - IBM OS/2 Unmoderated Discussion List

-------------------------------------------------------------------------
Jim Cassell                                    CASSELL@UNCVM1.OIT.UNC.EDU
Institute for Research in Social Science       CASSELL@UNCVM1.BITNET
University of North Carolina-Chapel Hill       Phone:  919-962-0782
Chapel Hill, NC  27599-3355                    Fax:    919-962-4777
-------------------------------------------------------------------------
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Fri, 31 Jul 1992 11:56:45 EDT
Reply-To:     George McCarthy <mccarthy@LEVY.BARD.EDU>
From:         George McCarthy <mccarthy@LEVY.BARD.EDU>
Subject:      Panel Logit
Comments: To: sas-l@vtvm1.cc.vt.edu

Limdep 6.0 has a fixed effects estimator for panel binary logit models.  I'm
not sure about the properties of the panel estimatoe using lagged variables,
though.  Limdep also has a ramdom effects binomial probit model.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Mon, 27 Jul 1992 14:08:49 EDT
Reply-To:     Wendy Fraker <ATSWAF@UOFT01.BITNET>
From:         Wendy Fraker <ATSWAF@UOFT01.BITNET>
Subject: Test scoring in SAS

I am in charge of writing and maintaining Test Scoring programs that
compute each student's grade and also display the stats for each
individual and the class as a whole.

Most of the programs were written 10-12 years ago in SAS. Almost
all of the stats like STD, Frequencies etc. were calculated by
the programmer and printed out in a set format chosen by the
manager of the user services dept.

Instructors are constantly asking for changes in the output format
of the stats report or asking for exceptions to the type of
input being used (like more than one possible correct answer, different
sort parameters etc.) So I have to change the programs. What
I would like to know is, are there any SAS procedures that can
have a answer key input and then use that to tabulate the correct
answers and then along with whatever stats procedures are chosen
print out a report, that is a lot easier to debug than one in
which every part of the program is written by hand?
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Mailer: Elm [revision: 66.33]
Newsgroups: bit.listserv.sas-l
Date:         Mon, 27 Jul 1992 14:31:04 MDT
Reply-To:     knechod@stacc.med.utah.edu
From:         Kevin Nechodom <knechod@STACC.MED.UTAH.EDU>
Subject:      Re: Date Selection with Data Steps
Comments: To: MKEINTZ@PENNSAS.UPENN.EDU,
              SAS Mailing List <sas-l@uga.cc.uga.edu>

> On Mon, 27 Jul 1992 14:15:40 MDT you said:
> >I am trying to write a data step script that will select a subset of
> >records out of a data set that has each record dated.
> >
> Use date literals, as in the where command below.
>
> data new;
>     set old  ;
>     where '07MAY69'D <= cutdate <= '07JUN72'D ;
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Mark Keintz  mkeintz@pensas.upenn.edu         Ph: 215/898-6713
>              Population Studies Ctr/6298      Phila., PA 19104  USA

OOPS!  When I tried that, I left off the 'D'!  That will make it work
LOTS better!

--
Kevin Nechodom UofU STACC        | Great Moments in Physics History:
 UofU doesn't even know I exist; | "E= m c cubed?  No, too gaudy.
 how would they care what I say? |  E= m c ?  No, too simple.
knechod@stacc.med.utah.edu       |  E= m c squared?  Ah, ha!"
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Fri, 31 Jul 1992 10:48:29 CST
Reply-To:     Tom Purcell <GE0110@SIUCVMB.BITNET>
From:         Tom Purcell <GE0110@SIUCVMB.BITNET>
Subject:      SAS output as input to QUATRO-PRO

We have a frequent need to "import" sas output files into Quatro-Pro.
At present, we are doing a lot of "parsing".  Has anyone dealt with
the same problem and what solution have you done to solve the problem?

Thanks for any advice you are willing to provide.....
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Mon, 27 Jul 1992 10:32:55 EDT
Reply-To:     Howard Schreier <HIS@NIHCU.BITNET>
From:         Howard Schreier <HIS@NIHCU.BITNET>
Subject: Re: all possible combinations merge

CONTENT:  Response
SUMMARY:  SQL Equijoin is a many-many merge
REL/PLTF: 6.06 & Later

> I am running SAS 6.07 with VAX/VMS 5.5...
>
> Does anyone know of a good way of merging two data sets in an all combinations
> merge for the by-variable when there are duplicates of the by variable in both
> data sets to be merged and no other variable in common??  If I have three
> observations of a by-variable value in the first data set and 4 in the second,
> the final data set needs to have 12 observations with that value..
> -----------------------------------------------------------------------------
> Barbara Okerson                     BOKERSON@MEMSTVX1 (bitnet)
> SAS Consultant                      BOKERSON@MSUVX1.MEMST.EDU (internet)
> Academic Computer Services          (901)678-3682 (voice)
> Memphis State University
> Memphis, TN  38152

Use PROC SQL. The "equijoin" operation does precisely this.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\   Howard Schreier, U.S. Dept. of Commerce, Washington    /
/                     MVS 5.18 & 6.07                      \
\   Voice: (202) 377-4180        BITNET: HIS@NIHCU         /
/   Fax:   (202) 377-4614      INTERNET: HIS@CU.NIH.GOV    \
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Wed, 29 Jul 1992 13:15:59 EDT
Reply-To:     Howard Schreier <HIS@NIHCU.BITNET>
From:         Howard Schreier <HIS@NIHCU.BITNET>
Subject:      SQL Optimizer

CONTENT:  Response
SUMMARY:  SQL automatically seeks shortcuts, but user can help
REL/PLTF: 6.06+

Inquiry from a user of PROC SQL:

> I am using PROC SQL to match up rows of a large dataset, by merging a
> table with itself.  The dataset is primarily defined by IDN (id
> number).  In using SQL, the big table is formed as the Cartesian
> product of all rows.  Since there are 7138 rows, the interim table
> (before WHERE processing) is large.  Can I restrict PROC SQL to form
> interim tables separately for each value of IDN?

PROC SQL has optimization techniques built  in,  but  users'
coding  and  other  decisions  (such  as index creation) can
affect the process.  See pp.  74-78 of the SAS Guide to  the
SQL  Procedure,  as  well  as Paul Kent's 1991 and 1992 SUGI
papers.

Where possible, SQL will avoid constructing all rows of  the
Cartesian  product.   In this case, if the WHERE clause is a
simple equality  test  ("where  left.IDN  =  right.IDN"),  I
believe   the  optimizer  will  automatically  do  what  you
envision, so the query should not take long.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\   Howard Schreier, U.S. Dept. of Commerce, Washington    /
/                     MVS 5.18 & 6.07                      \
\   Voice: (202) 377-4180        BITNET: HIS@NIHCU         /
/   Fax:   (202) 377-4614      INTERNET: HIS@CU.NIH.GOV    \
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Tue, 21 Jul 1992 11:56:58 LCL
Reply-To:     RIKARD@VCUMVS.BITNET
From:         RIKARD@VCUMVS.BITNET
Subject:      Sort stuff

******************************************************************
Content: Response
Summary: Proc Sort.
Release and platform: 5.18 and 6.07 under MVS
Name:    Pete Rikard
Mail addresses:BITNET Rikard@vcumvs Internet rikard@vcuucc.ucc.vcu.edu
Real Addresses:Virginia Commonwealth University, Computer Center
               110 S. 7th Street, 4th Floor, Richmond, VA 23219
               Phone (804) 786-4828    FAX: (804) 371-8464
******************************************************************
I like it, I like it. I would call this a stupid user trick from
Late Night with SAS-L, but that wouldn't be SAS PC.
>    Sometimes, just when you think you understand the SAS algorithms,
>    something pops up and make you existentially insecure. Consider
>    the following.
>       A student was trying to sort two datasets by, say, id and
>    school, in order to merge them together.  She clearly wanted
>    the dataset to look like id's within school's. She tried
>    the following code:
>     proc sort data=one;
>        by school;
>        by id;
>     proc sort data=two;
>        by school;
>        by id;
>     data total;
>         merge one two;
>      by school;
>      by id;
>
>     Needless to say,  the merge did not work, as it did not find
>     the datasets "sorted" by school.  I straightened her out by
> ....   Anyway, what gives?  Can anyone suggest what SAS is doing here?
*****************************************************************
lots more good commentary followed.
Actually I have learned more from what my users tried to do and
the interesting results they got than from many well schooled
users.

I admit that I haven't seen anyone try this and it's wrong, wrong,
wrong. But it is interesting.

It's wrong, wrong, wrong cause what you get is apparently version
dependent. A partial test for MVS was:
  proc sort; by a b ; by descending b a;
      5.18 gives a b
      6.07 gives descending b a;
  proc sort; by a ; by descending b a;
      5.18 gives a descending b;
      6.07 gives descending b a;
  proc sort; by a ; by descending b ;
      5.18 gives a descending b;
      6.07 gives descending b ;
 5.18 appears to give the sort of the FIRST use of the variable
 in all BY statements and 6.07 seems to simply use the last BY
 statement given.

In any case, users should only have one by statement.
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Thu, 30 Jul 1992 21:50:32 -0500
Reply-To:     Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
From:         Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
Subject:      RE: DROP variables which are always MISSING?
Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
Comments: cc: GIBES@tin.monsanto.com

 CONTENT:   Response
 SUMMARY:   Brute-force method to DROP variables which are always MISSING
 REL/PLTF:  not applicable
 E-ADDR:    gibes@swirl.monsanto.com
 NAME:      Kernon Gibes
 PHONE:     (708) 506-2873
 DATE:      30 July 1992

Somebody asked:

>Is there any easy way to drop all variables whose values are ALWAYS
>missing in a SAS data step?  There are times when doing a PROC
>PRINT, for example, that you only want to look at the variables
>which have values and ignore all the rest, rather than explicitly
>coding each variable in the VAR statement.  Is there any way to
>conditionally drop variables?

I don't know of an "easy way", but a brute-force method for numeric
variables is given below.  This could obviously be packaged as a macro
in order to make it "easy" for the user, but it's late and I'm tired...

___ Source Code ________________________________________________________

options ls=72 nodate;
data test;
  input a b c d e f;
cards;
1  .  1  .  1  .
2  .  2  .  .  .
3  .  .  .  .  .
;
run;

proc means data=test noprint;
output out=miss nmiss=;
run;

data _null_;
   length varname $ 8 droplist $ 200;
   if 0=1 then set test nobs=n;
   set miss(drop=_type_ _freq_);
   array _nums {*} _numeric_;
   do i=1 to dim( _nums );
      if _nums[i] = n then do;
          call vname( _nums[i], varname );
          droplist = trim( droplist ) || ' ' || varname;
        end;
   end;
   call symput( 'droplist', trim(droplist) );
 stop;
run;

proc print data=test;
title1 "Before Dropping Any Variables";
run;

proc print data=test(drop=&droplist);
title1 "After Dropping ---ALL MISSING--- Variables";
title2 "(we dropped: &droplist)";
run;

___ Example SAS Output _________________________________________________


                     Before Dropping Any Variables                     1

                   OBS    A    B    C    D    E    F

                    1     1    .    1    .    1    .
                    2     2    .    2    .    .    .
                    3     3    .    .    .    .    .

               After Dropping ---ALL MISSING--- Variables              2
                         (we dropped:   B D F)

                           OBS    A    C    E

                            1     1    1    1
                            2     2    2    .
                            3     3    .    .
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
X-Envelope-to: sas-l@uga.BITNET
X-VMS-To: IN%"sas-l@uga"
Newsgroups: bit.listserv.sas-l
Date:         Mon, 27 Jul 1992 11:41:00 PST
Reply-To:     WALLY@FHCRCVAX.BITNET
From:         WALLY@FHCRCVAX.BITNET
Subject:      X-window server software for PCs

Fellow SAS-L'rs,

I've been discovering the wonders of SAS v6.07 under UNIX on a DECstation
and have been pleased with the performance and nice X-Windows interface.
Unfortunately I'm a bit hamstrung as the box does not sit on my desk and
so most of the time I must be content to talk to the machine via ethernet and
simple ASCII terminal emulation on my PC.
A potential solution would seem to be X-window emulation for the PC.

I'd like to tap the wisdom of anyone out there who has had experience with
X-Window server software for PCs.
Specifically:

- What PC X-window software are you using?
- Were special hardware requirements/enhancements needed on the PC,
  i.e. extra memory/disk space, special video cards/monitors, etc.?
- Any special considerations using the software with the SAS system?

Thanks for your help!

                                                  ,
---                                               |`\
Wally Meyer                                       |  `\
Fred Hutchinson Cancer Research Center            | _o/`\
wally@spock.fhcrc.org                              \ <\  `\
(206) 667-4985                                     ,---------'
---                                              ^^^^^^^^^^^^^^
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
X-Envelope-to: SAS-L@AWIIMC12.BITNET
X-Mailer: ELM [version 2.2 PL0]
Newsgroups: bit.listserv.sas-l
Date:         Fri, 31 Jul 1992 11:34:03 EDT
Reply-To:     Daryl P Sawders <DARYL@PITTUNIX.BITNET>
From:         Daryl P Sawders <DARYL@PITTUNIX.BITNET>
Subject:      RE: Comma delimited output file from SAS on MVS/ESA
              30, 92 9:22 pm

I agree.

>
> In my opinion what is needed is a DELIMITER= option for the FILE statement,
> analagous to the same option for the INFILE statement. This option would
> put the chosen delimiter between each variable named in a PUT statement,
> with no extra spaces, and using the usual default formats. Or user
> specified formats. Then people who wanted tab or comma delimiters could
> do something as simple as:
>
> data _null_;
>   set whatever;
>   file 'outfile.dat' delimiter=',';
>   put x y z;
>   run;
>
> What could be simpler?
> ---------------------------------------------------
>

Especially if  "delimiter" could be a variable length string.

  - Daryl -
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Newsgroups: bit.listserv.sas-l
Date:         Tue, 28 Jul 1992 16:52:20 EDT
Reply-To:     Andy Norton <76350.1604@COMPUSERVE.COM>
From:         Andy Norton <76350.1604@COMPUSERVE.COM>
Subject:      writing variable names to external file
Comments: To: SAS-L <SAS-L@AWIIMC12.IMC.UNIVIE.AC.AT>

From:      Andy Norton    (616) 344-2191   76350.1604@compuserve.com
Address:   Trilogy Consulting, 5228 Lovers Lane, Kalamazoo MI 49002
Rel/Pltf:  6.07 CMS
Re:        Response to Steve Wickham
           "Writing variable names to an external file"

Steve Wickham (SWICKHAM%DARTCMS1.BITNET) writes
>  I have a transposed data set that I'd like to write to an external
>  file, with variable names at the top of columns.  Put 'var1'
>  'var2', etc. where var1 is the 1st variable name, etc. won't work
> because I don't exactly know the names of the variables
> due to the transpose.  The transposed variables all have the same
> prefix, but they also have a number that ranges between 0 - 99, but
> not consecutively.
>   Confused? An example:
> DATE RIVER SITE ORDER1 ORDER3 ORDER5 ORDER17 ORDER9 ORDER85
> I need to output these column headings along with their values
> without knowing their names beforehand.  Any ideas?

Try the following:

   data _null_;
     set TRANSPOS;
     array ORDER {*} ORDER: ;
     if _N_ eq 1 then
        do;
        length NAME $ 8;
        do I = 1 to dim(ORDER);
           call vname(V{I}, NAME);
           put NAME $8.-r +2 @;
           end;
        put;
        end;
     do I = 1 to dim(ORDER);
        put V{I} 8. +2 @;
        end;
     put;
run;

--------------
Note 1:
   ORDER: refers to all variables beginning with "ORDER".  I think
these "prefix variable lists" will work on your VMS system.  They work
on CMS 6.07.  They are mentioned in print on page 1205 of the Version 5
manual, and in SAS Usage note V5-SYS.COMP-0630.  In other words, use at
your own risk.  If you don't want to use them, you can list all the
variables here.

Note 2:
   CALL VNAME is documented on page 634 of the version 6 Language
Reference.  The variable name from the first argument is placed into
the second argument.  The length of the second argument (NAME) should
be explicitly declared.

Note 3:
   $8.-r
   This right-justifies the names so that they line up with the
numbers.  See page 462 of version 6 Language Reference.

                                  Andy
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU