Solved

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

Posted on 2014-01-27
1
419 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installatā€¦
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now