From: UPHILG@UNC.BITNET (Philip Gallagher,(919)966-1065)
Newsgroups: bit.listserv.sas-l
Subject: Refs for SUBSTR as pseudovariable
Date: 15 Oct 92 17:11:00 GMT
Reply-To: "Philip Gallagher,(919)966-1065" <UPHILG@UNC.BITNET>
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU


    Multiple thanks to all who helped me out of my ignorance
    with respect to use of SUBSTR as a pseudovariable.  I did
    look in the indices of four of the V.6 manuals, tracked down
    every reference I found to SUBSTR, and never found the pseudo-
    variable discussion.  I should have done what I tell my students
    to do first:  read the V.5 Basics manual.

    The single face-saving feature of this incident is that, at least,
    I did not stupidly tell the student that her idea was all wet.
    Unbelievably I had sense enough to tell her that I had never seen
    that construction in SAS, and that we should check it out.
    Hallelujah, I'm a bum!  Hallelujah, bum again!  Hallelujah,
    thanks for the handout, it revived me again!

    The program was part of a cutesy invented homework assignment
    (in which I have a little fun with the nickname of a well-known
    personage at a University with which we maintain a (!) friendly (!)
    rivalry.  If anyone else (someone already has) would like a
    copy of the assignment tell me and I will be pleased to send it.
    Assignment emphasizes use of character string handling functions,
    character variables, etc.  Reasonably straight forward.
    Which reminds me:  some time ago (two years?) there was discussion
    on the list with respect to establishing a collection of
    homework assignments.  I think it never really came to fruition,
    probably for logistical reasons.  Anyone still interested, with
    suggestions for a scheme that will really work?

    Here follows a modestly edited compilation of the answers I
    received.  I should have looked harder.

                       Phil Gallagher
                       uphilg@unc
========================================================================
From:    RIKARD@VCUMVS.BITNET

SAS language Reference Manual, Version 6, page 602
========================================================================
From:        Bill Leimbach <WXL1@DCC.CC.VT.EDU>

Page 274 of the SAS User's Guide Basics, Version 5 Edition
talks about "pseudo-variable for character insertion" using the
SUBSTR function.  The discussion focuses on CATNIP rather than
RATFACE.
========================================================================
From:     "Howard Schreier" <HIS@NIHCU.BITNET>

V.5 big FM, pp. 274-275
V.6.06 big FM, p. 602

These cover use of of SUBSTR on LHS. Is there
something more to your example?
========================================================================
From:         Gerry <STATMAN@PACEVM.BITNET>

Second, you are right about PL/I allowing the Substr function used in the
manner as you described, as does SAS (since PL/I is one of the languages
I work in, all SAS similarities to it are welcomed!) and is documented in
the language reference for version 6 on page 602; one of the SAS manuals
refers to this use as a 'pseudo' variable assignment.

========================================================================
From:         Jozsef Vitrai <VITRAI@NKI.BITNET>

In SAS Language Guide for Personal Computer Release 6.03, on page 97
"SUBSTR: a dual function: substring and pseudo-variable for character
insertion". I have just found it yesterday!     Jozsef
========================================================================
From: "Robert M. Hamer 908-932-2696" <HAMER@ZODIAC.BITNET>

Well Phil, you old poop.
This is the use of the substring function as a pseudo-variable, and
it is documented, although I don't have the manual in front of me.
I do, for reasons of departmental boxes stored in my office, however,
have a 1982 manual in front of me, and in the index, under substring,
is an entry "pseudo-variable," so I assume it is still in the version
6.07 manuals.
========================================================================
From:         <MSZ03@ALBNYDH2.BITNET>

page 274, SAS Basics, Version 5 edition
"pseudo-variable for character insertion"

========================================================================
From:         Philip Tejera <TEJERA@BARUCH.BITNET>

This use of the SUBSTR function, under both Version 5 and Version 6, is
known as using SUBSTR on the left side of an equal sign, or using SUBSTR
as a pseudo-variable function, and is clearly documented in the FM under
the SUBSTR function. See for instance SAS User's Guide: Basics, Version 5
Edition, p. 274-275.

You are correct in that this capability also exists in PL/I, where it is
known as a "pseudovariable" function.

For those who use SPSS, this use of SUBSTR is also possible.
Newsgroups: bit.listserv.sas-l