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 (July 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 11 Jul 2000 17:05:32 GMT
Reply-To:     haworthl@MINDSPRING.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         haworthl@MINDSPRING.COM
Organization: Deja.com - Before you buy.
Subject:      Reformatting variables using metadata: need SQL and/or MACRO help

Okay, I'm feeling lazy. My hope is that someone has done this before.

My problem: I have two datasets (1) metatdata including variable names, and their appropriate formats; (2) raw data for these variables, all formatted as $200.

I want to use the metadata to create a third dataset with the variables all properly formatted.

Some sample data:

Dataset 1 VARNAME VARTYPE VARLEN VARDEC var1 char 10 var2 numb 8 2

Dataset 2 VAR1 VAR2 Coffee 0.75 Tea 1.25 Latte 2.50

What I want is a dataset 3 where VAR1 is formatted as $10. and VAR2 is formatted as 8.2

Any suggestions? I suspect this is a candidate for PROC SQL and/or a creative macro. Anyone have any code for something like this?

TIA,

Lauren Haworth

Sent via Deja.com http://www.deja.com/ Before you buy.


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