Hope this is what you need.
DATA LIST free/ course_c (a14).
STRING course_n (A6).
STRING year (A3).
STRING c_year (A3).
I developed it with the help of Raynald Levesque's previous posting.
Centre for Addiction and Mental Health
1001 Queen Street West
Toronto, Ontario, Canada
Phone: 416 535 8501 X 6534
From: Muir Houston [mailto:firstname.lastname@example.org]
Sent: May 1, 2003 6:12 AM
Subject: creating 3 variable out of string
I have been looking for some syntax which allows me to recode a string
variable into three separate variables depending on part of the string
my variable is named course_c
and is formatted like so:
example - SSSVMQ/YY3/9XE
i would like to create 3 variables from each course code
the first part of the string (to the first /) is course name [eg
the second part of the string (between the two slashes) is the year of
enrolment [eg YY3]
and the third part (after the last slash) is the serial year of the
course ie students can enrol directly into advanced years
i had a look at some previous postings but the recent ones seemed to
remove parts of the string itself to create new variable rather than
what i am after and as a relative novice syntaxer unable without
pointers to figure it out myself
The information transmitted is the property of the University of Paisley and
is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Statements and opinions expressed in this
e-mail may not represent those of the company. Any review, retransmission,
dissemination and other use of, or taking
of any action in reliance upon, this information by persons or entities
other than the intended recipient is prohibited.
If you received this in error, please contact the sender immediately and
delete the material from any computer.