?
Solved

checking the length of text field less than or equal to the assigned macro  - SAS

Posted on 2014-01-27
1
Medium Priority
?
449 Views
Last Modified: 2016-02-10
I am building a text field based on variables coming in from a list.
I have created the macro below

Data _null_;
call symput("format_textrecord", '$10000.');  /*Setup variable for textrecord length */
run;

Once the textrecord is built through processing, I would like to check the length of the textrecord field to ensure that it is less than 10000.

Is there a way to do this using the macro variable.  I know this can be done by hardcoding 10000 in an if statement, but I want to avoid as much manual interaction as possible so that the check and the format stay iin sync.
0
Comment
Question by:morinia
1 Comment
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 2000 total points
ID: 39811981
I'm not understanding what you wish to check against what so taking a stab here

You can store the max length permissible in a macro variable, then use sashelp.vcolumn do a query to check length the field (can't recall field name but probably is LENGTH) by filtering by LIBNAME = library where table is stored AND MEMNAME = table name AND NAME = column name
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question