From: Gaetan on
Hello,

excuse me for the language, I am french.

I have a trouble :

I have a colum in a data base and with values of this column, I would
like to create new var.

ex :

Name Sexe

John Man
Rita Woman

I would like to have in my database :

Name Sexe Man Woman

John Man 1 0
Rita Woman 0 1

My trouble is : I have lots of differents values like (men, women,
men1, men2, men3 , ...)

I have tried with macos functions SYMGET, SYMPUT to get automaticely
the values and create new columns bit I don't manage because the row :

symget("var")=1

doesn't work.

I hope you can understand what I say.

Thank you
Gaétan

From: Eric Eyre on
Bonjour Gaetan
Je suis familier avec [men, women] mais que sont les [men1, men2, men3, etc]
? Un nouveau type de genre? SVP aidez-nous ? comprendre ce nouveau et
difficile concept...vraiment, vraimant, comme totalement pour s?r dude

Erique

"qui est exact, je suis une personne de maths, je ne suis pas un de 4 sur 3
personnes qui ont des ennuis avec des fractions"

"Gaetan" <gaetan.soulas(a)ifen.fr> wrote in message
news:1148025175.083257.322680(a)i39g2000cwa.googlegroups.com...
Hello,

excuse me for the language, I am french.

I have a trouble :

I have a colum in a data base and with values of this column, I would
like to create new var.

ex :

Name Sexe

John Man
Rita Woman

I would like to have in my database :

Name Sexe Man Woman

John Man 1 0
Rita Woman 0 1

My trouble is : I have lots of differents values like (men, women,
men1, men2, men3 , ...)

I have tried with macos functions SYMGET, SYMPUT to get automaticely
the values and create new columns bit I don't manage because the row :

symget("var")=1

doesn't work.

I hope you can understand what I say.

Thank you
Ga?tan


From: Joep on
Gaetan,

You may want to look into Proc Transpose:

data tall;
length name $ 10;
name = 'Jean';
sexe = 'm';
output;
name = 'Jeannette';
sexe = 'f';
output;
name = 'Pierre';
sexe = 'm';
output;
name = 'Catherine';
sexe = 'f';
output;
run;

proc sort data=tall;
by name;
run;

proc transpose data= tall out=wide (drop = _name_);
by name;
id sexe;
var sexe;
run;

Although this example does not exactly give you your desired output.

Another thing is, do you really want to transpose datarows in a column
into several columns. At present I'm actually doing the opposite,
because the data structure of columns representing data elements is to
rigid. If a data element is added then I have to alter the
datastructure, which I think is not a good idea.

In my new data structure, I just add a new row.

Hope this is helpful,

Joep

From: Gaetan on
En fait, je vais donner une explication beaucoup plus simple :

je pense que la meilleure solution pour moi est de passer par un PROC
TABULATE mais un nouveau probleme se pose :

J'aimerai récupérer à la suite de la PROC TABULATE , une table
"resultat" de la meme forme que dans la fenêtre SORTIE, c'est à dire
un
tableau croisé dynamique.

Parce que lorsque j'utilse l'option OUT = resultat de la PROC TABULATE
,
la table "resultat" n'a pas la forme d'un tableau croisé dynamique.

Merci

From: Venky Chakravarthy on
On Fri, 19 May 2006 00:52:55 -0700, Gaetan <gaetan.soulas(a)IFEN.FR> wrote:

>Hello,
>
>excuse me for the language, I am french.

>
>I have a trouble :
>
>I have a colum in a data base and with values of this column, I would
>like to create new var.
>
>ex :
>
>Name Sexe
>
>John Man
>Rita Woman
>
>I would like to have in my database :
>
>Name Sexe Man Woman
>
>John Man 1 0
>Rita Woman 0 1
>
>My trouble is : I have lots of differents values like (men, women,
>men1, men2, men3 , ...)
>
>I have tried with macos functions SYMGET, SYMPUT to get automaticely
>the values and create new columns bit I don't manage because the row :
>
>symget("var")=1
>
>doesn't work.
>
>I hope you can understand what I say.
>
>Thank you
> Ga?tan

Gaetan,

Can you present a small sample with the data that you HAVE
 |  Next  |  Last
Pages: 1 2
Prev: ODS Tagsets ExcelXP
Next: Help - Gini's Coefficient