f



Re: Parse Variable Name into SAS Variable Value

Try vname() function:

136  data _null_;
137  prem_disc_12_31_1987=23;
138  date_prem_disc=compress(vname(prem_disc_12_31_1987),'_abcdefghijklmnopqrstuvwxyz');

139  put date_prem_disc=;
140  run;

date_prem_disc=12311987
NOTE: DATA statement used:

-----Original Message-----
From: Tom Denton [mailto:denton@DUKE.EDU]
Sent: Friday, August 15, 2003 8:03 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Parse Variable Name into SAS Variable Value


Can anyone tell me how to parse out a variable name into sas variable value.

For example let's say I have a variable called prem_disc_12_31_1987

I'd like to set the date variable date_prem_disc equal to the sas date
value for 12311987 (parsed from the variable name above).

Any ideas?
0
yhuang (481)
8/15/2003 3:09:55 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
690 Views

Similar Articles

[PageSpeed] 32

Reply:

Similar Artilces:

Re: Assign variables to a new variable based on variable names in SAS #3
Here's a solution that builds a list of subscripts in macro variables named like the 'a_' columns in the input dataset. 'a_' fields are referenced by the subscript from the array they're defined to be part of: data stuff; a_2003q4 = 44; a_2003q1 = 11; a_2003q2 = 22; a_2003q3 = 33; n = 'a_2003q3'; run; proc sql noprint; create table columns as select name from sashelp.vcolumn where libname = 'WORK' and memname = 'STUFF' and name eqt 'a_' order by name ; select compbl('...

Re: Assign variables to a new variable based on variable names in SAS #6
Hi, Richard, Your data step, "monkeyshines" is one of the prettest I have ever seen. Really nice. The to-the-point array statement using the variable name wild character (":"); use of lbound() hbound() functions; use of _i_ for index variable; short but intuitive variable and array names like aVars, aBase, and aMap; use of intnx and intck functions, reading the returned variable name with ??yyq6. format, anticipation of range checking, and all the work was done in essentially a single line!("a_new = aVars[aMap[qtrIndex]];") ... I learn a lot just by reading your...

Re: Assign variables to a new variable based on variable names in SAS #5
Hi Chang & V - I'm confused as usual - did you mean this? 142 data one; 143 a_1995q3 = 1; 144 a_1995q4 = 2; 145 a_1997q1 = 3; 146 a_2003q4 = 5; 147 n = "2003q4"; 148 run; NOTE: The data set WORK.ONE has 1 observations and 5 variables. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds 149 150 data two; 151 set one; 152 call symput('n', n); 153 new_a = 'a_'||resolve(n); 154 put new_a=; 155 run; new_a=a_2003q4 NOTE: There were 1 observations read from the data set WORK.ONE...

Re: Assign variables to a new variable based on variable names in SAS #4
On Thu, 15 Jan 2004 11:02:05 -0800, W M <mwx74@HOTMAIL.COM> wrote: >I have met the following problem and I need your expert help. >The variable names in the data set looks like this: > >a_1995q3 a_1995q4 a_1997q1 ........... a_2003q4 n > Is there a way like > >new_a=a_{value of n} ? > >Because of the compilation of data step, you cannot do > >data new; set old; >call symput("name", n); >new_a=a_&n; (wrong !) >run; Hi, V, Following up on Paul (Choate)'s idea, this seems to work. This would serve as an example of putting an...

Re: Assign variables to a new variable based on variable names in SAS #7
Chang, I agree with your assessment of Richard's code. I especially liked that he offered it without any chest pounding! Joe -----Original Message----- From: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM> Sent: Jan 16, 2004 11:19 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Assign variables to a new variable based on variable names in SAS Hi, Richard, Your data step, "monkeyshines" is one of the prettest I have ever seen. Really nice. The to-the-point array statement using the variable name wild character (":"); use of lbound() hbound() f...

Re: Using the value of a SAS variable to select another variable
> From: myself > Subject: Re: Using the value of a SAS variable to select > another variable > > Hello again, > > I am now running into the 'reverse' problem, namely:, keeping > with my previous example, with the fields V1, P1, P2 and P3, > I need my code to do this, depending on the value in the > field V1 > If V1=1 then assign new values (which I calculate) > to the variables P2 and P3, > If V1=2 then assign new value to > P3 and so on. ah, this does not read as systematic > Again, I have more than just 3 fields P's I have 38 >...

Assign variables to a new variable based on variable names in SAS
Thank so much Nagakumar Sridhar and Fehd, Ronald J. for answering my previous question. However I was not clear in the original post. I modified my phrasing and the new version is below: I have met the following problem and I need your expert help. The variable names in the data set looks like this: a_1995q3 a_1995q4 a_1997q1 ........... a_2003q4 n Please note that "quarter" numbers in "a_****q*" variables may not be continuous, i.e. there might be a missing quarter. and n can have the value of any quarter for while a_quarter exists, say "1995q3", "...

Re: extracting the names of variable name in a sas dataset
In your original data set, give each variable a label, when you rename them or drop them, don't touch the label, at the end you can tell the original var name from their label: data xx; v1=2; v2=3; v3=4; label v1='v1' v2='v2' v3='v3' ; run; data xx; set xx; rename v1=z v2=k; drop v3; run; proc contents; run; HTH Ya On Tue, 26 Apr 2005 12:23:02 -0700, mehtakrishna2002@yahoo.com <mehtakrishna2002@YAHOO.COM> wrote: >Hi, >I rename the original variables (call the new variables v1-vxx) in a >sas dataset run some steps delete some variables ( I do not know before >hand the ones I will delete). At the end I want to be able to match it >back to the original names and generate the list of original variable >lists that got removed. Can anyone suggest a way? >Thanks for your help. >Regards, >Krishna ...

how to incorporate the value of one variable into a sas variable
Hello, I have data as follows id prod_code bal 1 boat 100 1 car 200 2 he 40 3 car 100 Basically this is bal per customer by account type. What I need is one record per id, as id bal_boat bal_car bal_he 1 100 200 . 2 . . 40 3 . 100 . Since I have alot of product codes, I would like a macro approach that will automate and customize the naming of the variables in output data set. I read with interest the transpose solution give in the recent thread "splitting an recombining a dataset" and I had intended to go with that approach, using proc expand to deal with probable non-existant account types at the id level (eg not all ids will have all prod codes). However, my collegue senses this would be, at the least, not an elegant approach. Many thanks in advance for you time! T.J. Elle On Jul 24, 4:06=EF=BF=BDpm, tj.el...@SUNTRUST.COM ("T.J. Eller") wrote: > Hello, > > I have data as follows > > id prod_code bal > 1 =EF=BF=BDboat =EF=BF=BD =EF=BF=BD =EF=BF=BD =EF=BF=BD100 > 1 =EF=BF=BDcar =EF=BF=BD =EF=BF=BD =EF=BF=BD200 > 2 =EF=BF=BDhe =EF=BF=BD =EF=BF=BD =EF=BF=BD =EF=BF=BD 40 > 3 =EF=BF=BD car =EF=BF=BD =EF=BF=BD =EF=BF=BD 100 > > Basically this is bal per customer by account type. > > What I need is one record per id, as > > id bal_boat bal_car bal_he > 1 =EF=BF=BD 100 =EF=BF=BD =EF=BF=BD =EF=BF=BD200 =EF=BF=BD =EF=BF=BD =EF= =BF=B...

Re: Converting Variable Values to Variable Names
Warren You could do this with arrays but I like Proc Transpose since it is a more general solution. Data warren; input Name $2. percent High_Val Low_Val; cards; BR 25 0.5 0.25 BR 50 0.6 0.30 BR 75 0.8 0.61 CL 25 0.45 0.26 CL 50 0.71 0.31 CL 75 0.9 0.63 FL 25 0.51 0.35 FL 50 0.62 0.40 FL 75 0.81 0.70 run; proc transpose out = warren; by name percent; var high_val low_val; run; proc sort; by percent _name_ ; run; Proc transpose out = warren; by percent _name_; id name; run; proc print; run; Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Warren Schlechte <Warren.Schlechte @TPWD.STATE.TX.US To > SAS-L@LISTSERV.UGA.EDU Sent by: "SAS(r) cc Discussion" <SAS-L@LISTSERV.U Subject GA.EDU> Converting Variable Values to Variable Names 09/26/2008 01:13 PM Please re...

Re: create variable names from values of other variable
data xx; input id date value; cards; 1 200801 100 2 200802 101 3 200803 99 ; filename xx temp; data yy; set xx (where=(value >=100)); file xx; if _n_=1 then put 'data zz; set xx;'; ls='value_'||put(date,6.-l)||'='||put(value,best.-l)||';'; put ls; run; %include xx; run; proc print data=zz; run; value_ value_ id date value 200801 200802 1 200801 100 100 101 2 200802 101 100 101 3 200803 99 100 101 On Thu, 24 Jul 2008 17:31:46 -0700, learner <cnfengshuang@GMAIL.COM> wrote: >Hi, > >What I want to do is like this. Suppose I have some data as below. > >id date value >1 200801 100 >2 200802 101 >3 200803 99 > >I want to create a new variable each time value>=100, with part of the >variable name record the date. like this: > >id date value value_200801 value_200802 >1 200801 100 100 101 >2 200802 101 100 101 >3 200803 99 100 101 > >I have a large data set to process like this, so please help me to >find an easy way to do it. I am going to do numerical analysis for >each id, and need to drop the added variables in the process of >calculation before processing the next id, to save system resource. >Can I do this in the DATA step? or is IML better...

Re: Parsing SAS Variable
Jerry Try the following. Note that I added a second obs that was longer than the one in the first. Data one; LENGTH COL1 COL2 $ 35; col1 = 'X5 X8 X12 X9 X1'; Col2 ='1990 1991 1992 1993 1994'; output; col1 = 'X7 X6 X52 X4 X3 X2 X1'; Col2 ='2990 2991 2992 2993 2994 2666 3333'; output; run; Data one; set one; length s1 $2 s2 $4 ; _I_ = 0 ; Drop _I_ col1 col2; Do until( s1 ='' ); _I_ + 1; s1 = scan( col1 , _I_ ); s2 = scan( col2 , _I_ ); if s1 gt '' then output; end; run; Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 jerry8989@GMAIL.C OM Sent by: "SAS(r) To Discussion" SAS-L@LISTSERV.UGA.EDU <SAS-L@LISTSERV.U cc GA.EDU> Subject Parsing SAS Variable 01/22/2009 08:44 AM Please respond to jerry8989@GMAIL.C OM I have SAS data set with 2 columns(Variables) that have data that is laid out like this Column1 X5 X8 X12 X9 X1 Column2 1990 1991 1992 1993 1994 I have no control on how many values that can be in 1 cell. There could be 1 or ...

Re: extracting the names of variable name in a sas dataset #4 645685
"mehtakrishna2002@yahoo.com" <mehtakrishna2002@yahoo.com> wrote: > I rename the original variables (call the new variables v1-vxx) in a > sas dataset run some steps delete some variables ( I do not know before > hand the ones I will delete). At the end I want to be able to match it > back to the original names and generate the list of original variable > lists that got removed. Can anyone suggest a way? I see that Ya has already given you a good suggestion. As always. Let me ask a question instead. Why do you need to do this? Why can't you keep the original names as you work? Why are deleting some of your variables in a process which prevents you from knowing their names? Okay, that's three questions. Sorry. :-) I think that, if you write back to SAS-L (not to me personally) with a more detailed discussion of your REAL problem, someone might be able to give you a much more useful answer. In the meantime, I'll be sitting here and wondering if this is going to turn out to be a statistical issue in variable selection... David -- David Cassell, CSC Cassell.David@epa.gov Senior computing specialist mathematical statistician ...

Re: extracting the names of variable name in a sas dataset #5 1547000
Of course using variable labels this way precludes their use for their intended purpose and destroys any existing labels. I would suggest not renaming the variables, thereby avoiding the problem altogether. On Tue, 26 Apr 2005 13:26:16 -0700, Choate, Paul@DDS <pchoate@DDS.CA.GOV> wrote: >Nice idea Ya, with the VLABEL and an array, or metadata from the dictionary >it would be easy to compare the two. > >Paul Choate >DDS Data Extraction >(916) 654-2160 > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ya >Huang >Sent: Tuesday, April 26, 2005 1:10 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: extracting the names of variable name in a sas dataset > >In your original data set, give each variable a label, >when you rename them or drop them, don't touch the label, >at the end you can tell the original var name from their >label: > >data xx; >v1=2; v2=3; v3=4; >label v1='v1' > v2='v2' > v3='v3' > ; >run; > >data xx; > set xx; >rename v1=z v2=k; >drop v3; >run; > >proc contents; >run; > >HTH > >Ya > >On Tue, 26 Apr 2005 12:23:02 -0700, mehtakrishna2002@yahoo.com ><mehtakrishna2002@YAHOO.COM> wrote: > >>Hi, >>I rename the original variables (call the new variables v1-vxx) in a >>sas dataset run some steps delete some variables ( I do not kn...

Re: extracting the names of variable name in a sas dataset #4 1546993
Nice idea Ya, with the VLABEL and an array, or metadata from the dictionary it would be easy to compare the two. Paul Choate DDS Data Extraction (916) 654-2160 -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ya Huang Sent: Tuesday, April 26, 2005 1:10 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: extracting the names of variable name in a sas dataset In your original data set, give each variable a label, when you rename them or drop them, don't touch the label, at the end you can tell the original var name from their label: data xx; v1=2; v2=3; v3=4; label v1='v1' v2='v2' v3='v3' ; run; data xx; set xx; rename v1=z v2=k; drop v3; run; proc contents; run; HTH Ya On Tue, 26 Apr 2005 12:23:02 -0700, mehtakrishna2002@yahoo.com <mehtakrishna2002@YAHOO.COM> wrote: >Hi, >I rename the original variables (call the new variables v1-vxx) in a >sas dataset run some steps delete some variables ( I do not know before >hand the ones I will delete). At the end I want to be able to match it >back to the original names and generate the list of original variable >lists that got removed. Can anyone suggest a way? >Thanks for your help. >Regards, >Krishna ...

Re: Converting Variable Values to Variable Names #8
On 9/26/08, Nat Wooding <Nathaniel.Wooding@dom.com> wrote: > Somehow, I got hooked on Transpose a long while back and have learned to > think well (sort of) using it. At one time is eschewed PROC TRANSPOSE for ARRAYS and thought I knew "best". Then one day I decided to try and learn PROC TRANSPOSE so I would have a basis for comparison. PROC TRANSPOSE has the unique ability to create variable names from data. At least I believe that characteristic is unique to PROC TRANSPOSE. That is, I can "say" use this variable to create names. Labels too. And I don't need to know much about the variable, like how many levels, or type. For multiple variable wide to tall transposes the data step array is still a good one step solution. But for tall to wide transposes I believe the features of PROC TRANSPOSE are superior to most ARRAY techniques. Another useful feature of transpose is the ability to convert numeric data to character using the variable(s) associated format. Poor mans VVALUE if you will. Plus there is "SAS Variable List" expansion into a data set. Preserving order and duplication. http://tinyurl.com/5yxq72 Others? ...

Re: Converting Variable Values to Variable Names #4
Paul Never fear, many of your arrays leave my head spinning. Somehow, I got hooked on Transpose a long while back and have learned to think well (sort of) using it. I should point out that in general, my code is run only a few times or only sporadically and never on huge files so I am more concerned with saving my coding time vs optomizing on machine cycles. How is you SESUG session coming? See 'ya in a few weeks. Nat Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Paul Dorfman <sashole@BELLSOUT H.NET> To SAS-L@LISTSERV.UGA.EDU, Nat Wooding 09/26/2008 03:36 <Nathaniel.Wooding@DOM.COM> PM cc Subject Re: Converting Variable Values to Variable Names Nat, Whether Transpose is more general or not perhaps depends on whether the arrays are sized dynamically or by hand. I admire your solution. I have never been able to properly wrap my crevices around Transpose, and aside from simplest cases, it always takes me less time to arrive at a solution of this kind procedurally then to figure out ...

Re: Passing value of variable (rather than the variable name) to
On Wed, 2 Apr 2008 05:51:00 -0700, hiemstra@yahoo.com <hiemstra@YAHOO.COM> wrote: >I have had trouble improving the macro below so that I can pass the >name of variable rather than a value for _y4mmdd. When I try, the >variable name passes rather than the contents of the variable. I know >that this is a scoping problem between the macro processor and regular >processing, but I do not know how to resolve it. > >Can someone lend me a hand? > >Stephen > >************************ > >%MACRO MakYrQtr( _y4mmdd, _dropit ); > /* This macro works only for number inputs. Variables do not >translate. > Make a yearqtr variable from a YYYYMMDD date or YYYYMM >date. > If _dropit = 1, drop month, qtr, and year. If _dropit = 0, keep >them. */ > > %LOCAL _y4mmdd _dropit; > > %LogName( MakYrQtr, 0 ); > %reminder( %STR(Make a yearqtr variable from &_ymmdd date. Flag >value is &_dropit), 0 ); > > %IF ( %LENGTH(&_y4mmdd) EQ 6 ) %THEN %DO; > year = INT( &_y4mmdd/100 ); > month = INT( &_y4mmdd ) - year*100; > %END; > %ELSE %DO; > year = INT( &_y4mmdd/10000 ); > month = INT( &_y4mmdd/100 ) - year*100; > day = &_y4mmdd - (year*10000) - (month*100); > %END; > > SELECT(month); > WHEN(1,2,3) qtr=1; > WHEN(4,5,6) qtr=2; > WHEN(7,8,9) qtr=3; ...

Re: Converting Variable Values to Variable Names #5
I am continually amazed at the SAS Skills in this group. Thanks for your amazing response. I was trying to do this in a data step; I never thought SQL could create such a table. I appreciate you taking the time to code this solution and send it to me. Further, thanks for commenting about what the code is doing, so I could better understand it. Sincerely, Warren -----Original Message----- From: Paul Dorfman [mailto:sashole@BELLSOUTH.NET] Sent: Friday, September 26, 2008 2:25 PM Subject: Re: Converting Variable Values to Variable Names Warren, If your intrinsic data structure guarantees that the size of each separate NAME group is the same across the data set, consider (I have added the ZZ data group to the test data set for the sake of generality) : data a ; input Name $ percent High_Val Low_Val ; cards ; BR 25 0.5 0.25 BR 50 0.6 0.30 BR 75 0.8 0.61 CL 25 0.45 0.26 CL 50 0.71 0.31 CL 75 0.9 0.63 ZZ 25 0.1 0.11 ZZ 50 0.2 0.22 ZZ 75 0.3 0.33 FL 25 0.51 0.35 FL 50 0.62 0.40 FL 75 0.81 0.70 ; run ; proc sql noprint ; select distinct name into: nm separated by ' ' from a ; select max (ct) into :gp from (select count(*) as ct from a group name) ; r...

Re: Converting Variable Values to Variable Names #2
Warren, If your intrinsic data structure guarantees that the size of each separate NAME group is the same across the data set, consider (I have added the ZZ data group to the test data set for the sake of generality) : data a ; input Name $ percent High_Val Low_Val ; cards ; BR 25 0.5 0.25 BR 50 0.6 0.30 BR 75 0.8 0.61 CL 25 0.45 0.26 CL 50 0.71 0.31 CL 75 0.9 0.63 ZZ 25 0.1 0.11 ZZ 50 0.2 0.22 ZZ 75 0.3 0.33 FL 25 0.51 0.35 FL 50 0.62 0.40 FL 75 0.81 0.70 ; run ; proc sql noprint ; select distinct name into: nm separated by ' ' from a ; select max (ct) into :gp from (select count(*) as ct from a group name) ; run ; data b (keep = percent ind_high &nm) ; array nm &nm ; array hl [0:1] low_val high_val ; do _n_ = 1 to &gp ; do Ind_high = 0, 1 ; do over nm ; p = (_i_ - 1) * &gp + _n_ ; set a point = p ; nm = hl [ind_high] ; end ; output ; end ; end ; stop ; run ; Essentially, the step marches through the records 1, 4, 7, 10 twice: once for low_val, and once - for high_val; then it does the same for records 2, 5, 8, 11; and so forth. SQL is used to...

Re: urgent : Convert SAS array in to sas variables
Shailesh, Why would you want to do what you ask? What you are asking would create the variable for all observations, but the variables' values would be missing values for every observation except the one on which it is based. Art ----- On Sat, 3 May 2008 23:34:44 -0700, Shailesh <shailesh.tewari@GMAIL.COM> wrote: >In my dataset I have an array variable , say A which has values like >Observation 1 - A[1]= 23 ,A[2]=34, A[3]=45 >Observation 2 - A[11]= 23 ,A[12]=34, A[13]=45 > >I want to create sas variables which should have name A61, A62 , A63, >A64 .......... >Similarly for second observation these would be A71, A72, >A73 , A74......... > > >in the same datastep. > >Any help ? > >Regards, >Shailesh ...

Re: Create variable names from variable values and transpose.
Perhaps this could be helpful to you. data work.test; input ID Flag @@; cards; 1 3 1 300 2 2 2 4 2 5 2 9 3 5 3 7 4 1 4 3 4 5 ;;;; run; proc sql noprint; select max(flag) into :maxFlag from work.test; run; data work.Flag; if 0 then set work.test(keep=Id); array v[&maxFlag]; /* set all elements in array to 0 */ call pokelong(repeat(put(0,rb8.),dim(v)-1),addrlong(v[1]),8*dim(v)); do until(last.id); set work.test; by id; v[flag] = 1; end; drop flag; run; proc print; run; On 3/23/07, C.A.N. <healthysheep@yahoo.com> wrote: > Have this (actual flag range is 1 - 300+) > > ID Flag > 1 3 > 2 2 > 2 4 > 2 5 > 2 9 > 3 5 > 3 7 > 4 1 > 4 3 > 4 5 > > Want. Would like to only have values that show up in the Flag field > end up as variables. > > ID 1 2 3 4 5 7 9 > 1 0 0 1 0 0 0 0 > 2 0 1 0 1 1 0 1 > 3 0 0 0 0 1 1 0 > 4 1 0 1 0 1 0 0 > > Any suggestions? Thanks in advance. > ...

Re: create variable names from values of other variable #2
On Thu, 24 Jul 2008 17:31:46 -0700, learner <cnfengshuang@GMAIL.COM> wrote: >Hi, > >What I want to do is like this. Suppose I have some data as below. > >id date value >1 200801 100 >2 200802 101 >3 200803 99 > >I want to create a new variable each time value>=100, with part of the >variable name record the date. like this: > >id date value value_200801 value_200802 >1 200801 100 100 101 >2 200802 101 100 101 >3 200803 99 100 101 > >I have a large data set to process like this, so please help me to >find an easy way to do it. I am going to do numerical analysis for >each id, and need to drop the added variables in the process of >calculation before processing the next id, to save system resource. >Can I do this in the DATA step? or is IML better? > >TIA >Learner Try this: data have; informat id $1. date yymmn6.; format date yymm7.; input id date value ; cards; 1 200801 100 2 200802 101 3 200803 99 ; data ge100; set have; where value ge 100; run; proc transpose data=ge100 out=wide(drop=_name_) prefix=value_; id date; var value; run; data want; set have; if _n_=1 then set wide; run; ...

Re: create variable names from values of other variable #3
On Thu, 24 Jul 2008 23:25:34 -0400, Howard Schreier <hs AT dc-sug DOT org> <schreier.junk.mail@GMAIL.COM> wrote: >On Thu, 24 Jul 2008 17:31:46 -0700, learner <cnfengshuang@GMAIL.COM> wrote: > >>Hi, >> >>What I want to do is like this. Suppose I have some data as below. >> >>id date value >>1 200801 100 >>2 200802 101 >>3 200803 99 >> >>I want to create a new variable each time value>=100, with part of the >>variable name record the date. like this: >> >>id date value value_200801 value_200802 >>1 200801 100 100 101 >>2 200802 101 100 101 >>3 200803 99 100 101 >> >>I have a large data set to process like this, so please help me to >>find an easy way to do it. I am going to do numerical analysis for >>each id, and need to drop the added variables in the process of >>calculation before processing the next id, to save system resource. >>Can I do this in the DATA step? or is IML better? >> >>TIA >>Learner > >Try this: > > data have; > informat id $1. date yymmn6.; > format date yymm7.; > input >id date value ; cards; >1 200801 100 >2 200802 101 >3 200803 99 > ; > > data ge100; > set have; > wh...

Web resources about - Re: Parse Variable Name into SAS Variable Value - comp.soft-sys.sas

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

Mozilla moves Firefox to variable release schedule
... schedule process "carefully" and learning "a lot" from it in the past years, Mozilla has announced that Firefox is now moving to a variable ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Staley: 'A lot of different variables...been a hard year'
... 41° Navigation Home Giants A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Staley: 'A lot of different variables...been ...

When your environment variables are showing
There are embarrassing moments in life. There is the teacher calling you out as a child in class as you stare out the window wistfully imagining ...

Resources last updated: 3/19/2016 7:22:12 AM