string variable issues

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

string variable issues

Khaleel Hussaini
Hello listers,
How can I use a string variable such as V1 for example below and convert it
into strint in this fashion
V1
1101
3430
101
11
12345

into V2, V3 V4, V5, V6
         1   1   0    1    .
         3   4   3     0    .
         1   0    1    .    .
          1   1    .    .    .
          1   2    3   4   5

Thanks,
KH.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: string variable issues

Spousta Jan
Hi Khaleel,

Into numbers:

do repe i = 1 to 5 / x = v2 to v6.
compute x = number(substr(v1, i, 1), f1).
end repe.
exe.
form  v2 to v6 (f1).

Into strings:

string v2 to v6 (a1).
do repe i = 1 to 5 / x = v2 to v6.
compute x = substr(v1, i, 1).
end repe.
exe.

Choose what is better for you.

Jan


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Khaleel Hussaini
Sent: Wednesday, April 02, 2008 12:59 AM
To: [hidden email]
Subject: string variable issues

Hello listers,
How can I use a string variable such as V1 for example below and convert it into strint in this fashion
V1
1101
3430
101
11
12345

into V2, V3 V4, V5, V6
         1   1   0    1    .
         3   4   3     0    .
         1   0    1    .    .
          1   1    .    .    .
          1   2    3   4   5

Thanks,
KH.

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD



_____

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

-.- --

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD