From 298acc4e50a70be7c4964f3ff11fb6c96fb216a1 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Fri, 7 May 2021 11:20:01 +0300 Subject: [PATCH] fix: setting default to best. over 8. for mf_getformat with force option --- all.sas | 10 +++++----- base/mf_getvarformat.sas | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/all.sas b/all.sas index 23cc361..e25f330 100644 --- a/all.sas +++ b/all.sas @@ -932,9 +932,9 @@ options noquotelenmax; 8. NOTE: Variable renegade does not exist in test - @param libds Two part dataset (or view) reference. - @param var Variable name for which a format should be returned - @param force Set to 1 to supply a default if the variable has no format + @param [in] libds Two part dataset (or view) reference. + @param [in] var Variable name for which a format should be returned + @param [in] force=(0) Set to 1 to supply a default if the variable has no format @returns outputs format @author Allan Bowe @@ -969,7 +969,7 @@ options noquotelenmax; %let vlen = %sysfunc(varlen(&dsid, &vnum)); %let vtype = %sysfunc(vartype(&dsid, &vnum.)); %if &vtype=C %then %let vformat=$&vlen..; - %else %let vformat=8.; + %else %let vformat=best.; %end; @@ -977,7 +977,7 @@ options noquotelenmax; %let rc = %sysfunc(close(&dsid)); /* Return variable format */ &vformat -%mend;/** +%mend mf_getVarFormat;/** @file @brief Returns the length of a variable @details Uses varlen function to identify the length of a particular variable. diff --git a/base/mf_getvarformat.sas b/base/mf_getvarformat.sas index 63aacdd..677b305 100755 --- a/base/mf_getvarformat.sas +++ b/base/mf_getvarformat.sas @@ -23,9 +23,9 @@ 8. NOTE: Variable renegade does not exist in test - @param libds Two part dataset (or view) reference. - @param var Variable name for which a format should be returned - @param force Set to 1 to supply a default if the variable has no format + @param [in] libds Two part dataset (or view) reference. + @param [in] var Variable name for which a format should be returned + @param [in] force=(0) Set to 1 to supply a default if the variable has no format @returns outputs format @author Allan Bowe @@ -60,7 +60,7 @@ %let vlen = %sysfunc(varlen(&dsid, &vnum)); %let vtype = %sysfunc(vartype(&dsid, &vnum.)); %if &vtype=C %then %let vformat=$&vlen..; - %else %let vformat=8.; + %else %let vformat=best.; %end; @@ -68,4 +68,4 @@ %let rc = %sysfunc(close(&dsid)); /* Return variable format */ &vformat -%mend; \ No newline at end of file +%mend mf_getVarFormat; \ No newline at end of file