Solved

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

Posted on 2014-01-27
1
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

740 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