错误:P没有数字后缀(SAS,RENAME)

时间:2016-09-21 18:33:21

标签: sas syntax-error

在解决了一堆其他错误后,我留下了以下内容

CursorAdapter

从我发现的所有信息中,当使用PROC TRANSPOSE时会发生这种情况很多,但是我在这里没有使用它(并且在此代码中没有其他地方)。

public class PostCursorAdapter extends CursorAdapter {

    public PostCursorAdapter(Context context, Cursor c, int flags) {
        super(context, c, flags);
    }

    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        return LayoutInflater.from(context).inflate(R.layout.post_list_item, parent, false);
    }

    @Override
    public void bindView(View view, final Context context, Cursor cursor) {
        String post = cursor.getString(cursor.getColumnIndex(DBOpenHelper.POST));
        final String liked = cursor.getString(cursor.getColumnIndex(DBOpenHelper.LIKED));
        String disliked = cursor.getString(cursor.getColumnIndex(DBOpenHelper.DISLIKED));
        final String post_id = cursor.getString(cursor.getColumnIndex(DBOpenHelper.POST_ID));


String userliked = cursor.getString(cursor.getColumnIndex(DBOpenHelper.USER_LIKED));


        TextView tvPost = (TextView) view.findViewById(R.id.tvPost );
        tvJoke.setText(post);

        TextView tvLikeCount = (TextView) view.findViewById(R.id.tvLikeCount);
        tvLikeCount.setText(liked);

        TextView tvDislikesCount = (TextView) view.findViewById(R.id.tvDislikeCount);
        tvDislikesCount.setText(disliked);

        final ImageView ivLike = (ImageView) view.findViewById(R.id.ivLike);
// has the user liked it?
int check = Integer.parseInt(userliked);
if(check == 1){
    String uri = "@drawable/like_blue";  // where myresource (without the extension) is the file
    int imageResource = context.getResources().getIdentifier(uri, null, context.getPackageName());
    Drawable res = context.getResources().getDrawable(imageResource);
    ivLike.setImageDrawable(res);
}
        ivLike.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String uri = "@drawable/like_blue"; 
                int imageResource = context.getResources().getIdentifier(uri, null, context.getPackageName());
                Drawable res = context.getResources().getDrawable(imageResource);
                ivLike.setImageDrawable(res);

            }
        });
    }

}

显然我有一堆以“p”开头的变量。它们都没有在日志中加下划线。我正在使用SAS Base,并在SAS Enterprise Guide中遇到了同样的错误。

不确定我的下一步应该是什么。感谢。

1 个答案:

答案 0 :(得分:2)

短划线不是变量名中的正确字符。

F25=P-ell替换为F25=P_ell

您可以使用短划线指定一系列变量,例如rename=(x1-x100=y1-y100)。此代码将前缀为x的100个变量重命名为y