trimming?

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

trimming?

Zdaniuk, Bozena-3
hello, i have a string variable A that has numbers and alphanumeric values. All data are left justified. I would like to create a numeric variable B with only the first three digits of the numeric values pulled from the string variable values. Would someone be willing to give me a hand?
thanks so much.
bozena zdaniuk
Reply | Threaded
Open this post in threaded view
|

Re: trimming?

Maguin, Eugene

Bozena,

 

This is a case where example data could be extremely important—unless the data are

A123eid

Z341oglkvi

Y897wsdo

 

In which case:

Compute y=number(substr(a,1,3),f3.0).

 

Where a is the string variable.

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Zdaniuk, Bozena
Sent: Sunday, May 06, 2012 6:28 PM
To: [hidden email]
Subject: trimming?

 

hello, i have a string variable A that has numbers and alphanumeric values. All data are left justified. I would like to create a numeric variable B with only the first three digits of the numeric values pulled from the string variable values. Would someone be willing to give me a hand?
thanks so much.
bozena zdaniuk

Reply | Threaded
Open this post in threaded view
|

Re: trimming?

Zdaniuk, Bozena-3
This is actually exactly what i needed. thanks so much!!
bozena

From: SPSSX(r) Discussion [[hidden email]] on behalf of Maguin, Eugene [[hidden email]]
Sent: Sunday, May 06, 2012 4:29 PM
To: [hidden email]
Subject: Re: trimming?

Bozena,

 

This is a case where example data could be extremely important—unless the data are

A123eid

Z341oglkvi

Y897wsdo

 

In which case:

Compute y=number(substr(a,1,3),f3.0).

 

Where a is the string variable.

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Zdaniuk, Bozena
Sent: Sunday, May 06, 2012 6:28 PM
To: [hidden email]
Subject: trimming?

 

hello, i have a string variable A that has numbers and alphanumeric values. All data are left justified. I would like to create a numeric variable B with only the first three digits of the numeric values pulled from the string variable values. Would someone be willing to give me a hand?
thanks so much.
bozena zdaniuk