zoukankan      html  css  js  c++  java
  • 【SAS NOTES】kindex判断字符串中是否含某子字符串& 用where在data步中选择部分数据

    Syntax
    KINDEX(source, excerpt)

    Arguments

    source
    specifies the character expression to search.

    excerpt
    specifies the string of characters to search for in the character expression.

    Tip: Enclose a literal string of characters in quotation marks.

    --------------------------------------------------------------------------------
    Details

    The KINDEX function searches source, from left to right, for the first occurrence of the string that is specified in excerpt, and returns the position in source of the string's first character. If the string is not found in source, KINDEX returns a value of 0. If there are multiple occurrences of the string, KINDEX returns only the position of the first occurrence.

     1 data guanhui.buedetail_same;
     2     set guanhui.buydetail (where=(KINDEX(serv_number,'1398888')=0));
     3     drop buy_date buy_clock buy_year buy_month buy_day buy_hour buy_minute  pay_date;
     4     format buy_time datetime18.;
     5     month=MONTH(datepart(buy_time));
     6     day=DAY(datepart(buy_time));
     7     hour=HOUR(buy_time);
     8     weekday=WEEKDAY(datepart(buy_time));
     9     quter=QTR(datepart(buy_time));
    10 run;
  • 相关阅读:
    C# winform 选择文件保存路径
    笔记
    Redis 队列好处
    异步线程
    WebApi 运行原理
    MVC ---- 怎删改查
    如何快速掌握一门新技术/语言/框架...
    膝盖中了一箭之康复篇
    翻译-Salt与Ansible全方位比较
    膝盖中了一箭之手术篇
  • 原文地址:https://www.cnblogs.com/colipso/p/2889202.html
Copyright © 2011-2022 走看看