,case when STATUS_CODE LIKE '%VP%' then
SUBSTR (STATUS_CODE , INDEX ( STATUS_CODE , 'VP'),2)
else '' end length=2 AS VP_STATUS
,case when STATUS_CODE LIKE '%VP%' then
SUBSTR (REASON_CODE , INDEX ( STATUS_CODE , 'VP'),2)
else '' end length=2 AS VP_REASON
,case when STATUS_CODE LIKE '%VP%' then
input(SUBSTR (STATUS_DATE , (INDEX ( STATUS_CODE , 'VP') * 3)-2 ,4) || '-'
||
SUBSTR (STATUS_DATE , (INDEX ( STATUS_CODE , 'VP') * 3)+2 ,2) || '-' ||
SUBSTR (STATUS_DATE , (INDEX ( STATUS_CODE , 'VP') * 3)+4 ,2) ,yymmdd10.)
else . end format date9. AS VP_DATE
Suppose like in the above example there are more than 100 "case when" statements written line by line in a .sas file. So if I read by infile statement it will read without hassel as all the lines of code are less than 32767 characters, but when I will append it into a single line then I can get the complete query at one line and it can be more than 32767 characters. I think it will be easy for me to pull any one case when statement from the bunch of case when statements.
case when STATUS_CODE LIKE '%VP%' then SUBSTR (STATUS_CODE , INDEX ( STATUS_CODE , 'VP'),2) else '' end length=2 AS VP_STATUS ,case when STATUS_CODE LIKE '%VP%' then SUBSTR (REASON_CODE , INDEX ( STATUS_CODE , 'VP'),2) else '' end length=2 AS VP_REASON
Now if I get the query like the above appended manner then I think if I want to retrieve only the below query then I can easily retrieve that with help sas string functions with some postional parameters. like Find or Findw funtions.
case when STATUS_CODE LIKE '%VP%' then SUBSTR (STATUS_CODE , INDEX ( STATUS_CODE , 'VP'),2) else '' end length=2 AS VP_STATUS
So, I just wanted to know, how to store the remaining caharacters from the point it will exceed 32767 characters.
Hope this much of information will help.
... View more