LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 2 Aug 2007 23:52:34 -0700
Reply-To:     "ckxplus@yahoo.com" <ckxplus@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "ckxplus@yahoo.com" <ckxplus@YAHOO.COM>
Organization: http://groups.google.com
Subject:      Re: Unformatted values in SAS Explorer
Comments: To: sas-l@uga.edu
In-Reply-To:  <668936B243AC5F4DB61EAE1878E9302708D4043D@mailbe1.westat.com>
Content-Type: text/plain; charset="us-ascii"

Hi Randy,

Thanks for the information. I don't have SAS/AF so your solution won't work for me. Another solution is use the SAS System Viewer (a free download) to view datasets without formats and SAS Explorer for datasets with formats. Not quite a click of a button though .... And for WORK datasets you have to navigate to the %sysfunc(pathname(work)) directory.

Thanks, John Hendrickx

On 2 aug, 23:22, RandyHerbi...@WESTAT.COM (Randy Herbison) wrote: > John, > > Assuming that you are using VIEWTABLE (VT) to view the data, I think the > short answer is no. As far as I know, VT always uses formats. If a > column does not have a user assigned format, VT uses defaults (best. for > num vars and $w. for char vars). > > There are several ways to make VT use default formats instead of > user-assigned formats. > > If you do not have SAS/AF, you can use the GSUBMIT command, in a SAS > Explorer action command, to make an unformatted copy of the data > on-the-fly (inefficient). > > If you have SAS/AF, you can use model SCL or the VT command's EXECCMD > argument. Either will require that you specify format widths for char > vars. You can use best. for num vars, and the default width is 12. If > you use $. for char vars, VT will set the format width to 1. > > If using model SCL, reset the formats in the DFINIT label. You won't be > able to toggle user-assigned/default formats this way, but you can set > all formats to defaults while VT initializes. > > Here's how it might look if you use the VT command's EXECCMD argument: > > execcmd: method inCmd :char > retCode :num > optional=outCmd :char; > > dcl list dsAttr={}, > char(32) column, > char(1) type; > > _self_._getDataSetAttributes(dsAttr); > > if inCmd='LOSEFORMATS' then do; > > do i=1 to listlen(getniteml(dsAttr,'COLUMN_LIST')); > column=getitemc(getniteml(dsAttr,'COLUMN_LIST'),i); > > _self_._getColumnAttribute(column,'type',type); > > if type='N' then > _self_._setColumnAttribute(column,'format','best.'); > else _self_._setColumnAttribute(column,'format','$8.'); > > end; > > retCode=1; > end; > > else do; > retCode=0; > call super(_self_, '_execCommand', inCmd, retCode, outCmd); > end; > > _self_=_self_; > endmethod; > > The EXECCMD command argument is used to implement custom command > processing. The custom command I use here is LOSEFORMATS. > > The Explorer action command is: > > VIEWTABLE %8b.'%s'.DATA execcmd=sasuser.vt_tools.execcmd2.scl:execcmd; > loseformats > > The LOSEFORMATS command gets processed immediately after the table is > opened by VT. > > You could add another custom command to the EXECCMD method to toggle the > user-assigned formats back on (you would need to store the user-assigned > format names to make them available for restoration). > > Another way to do this would involve persisting VT run time > customizations made by the user. EXECCMD is good for that too, but it's > a lot more complicated than the example above. I'll explain how if you > are interested. > > -Randy > > > > -----Original Message----- > From: owner-sa...@listserv.uga.edu [mailto:owner-sa...@listserv.uga.edu] > > On Behalf Of ckxp...@yahoo.com > Sent: Thursday, August 02, 2007 3:11 AM > To: sa...@uga.edu > Subject: Unformatted values in SAS Explorer > > I was wondering if there's a way to toggle the display of formatted and > unformatted variables when viewing a SAS dataset with the SAS Explorer. > I've found how to configure the Explorer to show variable names instead > of labels and to show the contents of a format if I double-click on it. > Now I'm wondering if there's some way to show unformatted values instead > of the default formatted values. > > Advance thanks for any help, > John Hendrickx- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven -


Back to: Top of message | Previous page | Main SAS-L page