I inserted STRING ResidenceZipcodes (A5). in the code and the error message went away and this new variable did get all the digits beyond 5 truncated. What confused me is that the original ResidenceZipcode showed on the variables table to be a string variable. I assumed that the source variable, not the resulting variable is what had to be a string variable and that it would make the resulting variable automatically a string variable too. I am a former SAS programmer, and that is how it was in SAS.
Thank you very much for the help. ________________________________ From: Pspp-users <[email protected]> on behalf of [email protected] <[email protected]> Sent: Thursday, March 4, 2021 4:07 PM To: [email protected] <[email protected]> Subject: Pspp-users Digest, Vol 177, Issue 2 Send Pspp-users mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit https://lists.gnu.org/mailman/listinfo/pspp-users or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Pspp-users digest..." Today's Topics: 1. Re: Error Message on SUBSTRG String Function (Frans Houweling) ---------------------------------------------------------------------- Message: 1 Date: Thu, 4 Mar 2021 22:07:43 +0100 From: Frans Houweling <[email protected]> To: [email protected] Subject: Re: Error Message on SUBSTRG String Function Message-ID: <[email protected]> Content-Type: text/plain; charset="windows-1252"; Format="flowed" Hi Ricardo, ResidenceZipcodes is a new variable here, and is therefore assumed to be numeric. Unless it was your intention re-assign to ResidenceZipCode, you need to declare the variable as a string: STRING ResidenceZipcodes (A5). HTH frans On 3/4/21 9:43 PM, Ricardo Mejias wrote: > Using a Substr string function on a string variable (see the screen > shots below) I get an error message saying: "the expression has string > type, but a numeric value is required here."Did I do something wrong > or is this a bug? > > > > > > > > > > I am using GNU pspp 1.4.1-g79ad47 with Windows 10 > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.gnu.org/archive/html/pspp-users/attachments/20210304/cd625184/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 11501 bytes Desc: not available URL: <https://lists.gnu.org/archive/html/pspp-users/attachments/20210304/cd625184/attachment.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23746 bytes Desc: not available URL: <https://lists.gnu.org/archive/html/pspp-users/attachments/20210304/cd625184/attachment-0001.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 27511 bytes Desc: not available URL: <https://lists.gnu.org/archive/html/pspp-users/attachments/20210304/cd625184/attachment-0002.png> ------------------------------ Subject: Digest Footer _______________________________________________ Pspp-users mailing list [email protected] https://lists.gnu.org/mailman/listinfo/pspp-users ------------------------------ End of Pspp-users Digest, Vol 177, Issue 2 ******************************************
