Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Appending the "SPSS Name" property problem

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 13, 2018 9:00 AM
(2207 views)

Hello,

I'm trying to append the "SPSS Name" property for all columns in my dataset with the string "_R1". This loop works until line 5; the result is that all the SPSS Names get changed to *SNname - *not the value of the variable, but the text *SNname*. I've tried putting it in quotes and I've tried using the Name() function and it still didn't work. I'm hoping someone can tell me the syntax I need to use to get this to work. I've attached an abbrievieted file of my data. Thanks!

```
For( i = 1, i <= N Cols( dt ), i++,
cName = Column(dt,i) << Get Property("SPSS Name");
SNname = cName|| "_R1";
show(SNname);
Column( dt, i ) << Set Property("SPSS Name", SNname );
);
```

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Set Property() is not going to evaluate SName. You probably need to parse SName before evaluating that line. Try this:

`Eval(Parse(Eval Insert("\[Column( dt, i ) << Set Property("SPSS Name", ^SNname^ )]\")));`

-- Cameron Willden

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Set Property() is not going to evaluate SName. You probably need to parse SName before evaluating that line. Try this:

`Eval(Parse(Eval Insert("\[Column( dt, i ) << Set Property("SPSS Name", ^SNname^ )]\")));`

-- Cameron Willden

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Appending the "SPSS Name" property problem

You need to perform an eval() on the variable SName.

```
For( i = 1, i <= N Cols( dt ), i++,
cName = Column(dt,i) << Get Property("SPSS Name");
SNname = cName|| "_R1";
show(SNname);
Column( dt, i ) << Set Property("SPSS Name", eval(SNname) );
);
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Appending the "SPSS Name" property problem

This is more elegant. Nice add Jim.

-- Cameron Willden