Desktop productivity for business analysts and programmers

how to scribe my expression in EG ? item numeric to character

Reply
N/A
Posts: 0

how to scribe my expression in EG ? item numeric to character

I'm French, but i try this in English...
my question is very simple for you I'm sure..
i use E guide 4, only with the Graphic Editor...(no programming in Sas)
I have a Table with a column numeric : idFiche ...format 17.(numeric ok)
i create a calculate column...idFicheCar with the tools by
i want a data character of 17 characters,
and i write this, in the Panel
PUTC(TableName.idFiche ,$17.)
but the validation done a error (in French)...
"la syntaxe de la requête comporte des erreurs..."

Why the expression is False ? I follow the spécification...I think
did i made a mistake of basic comprehension ?

merci à vous !
Super Contributor
Super Contributor
Posts: 3,174

Re: how to scribe my expression in EG ? item numeric to character

Try the code example below using the PUT function for a DATA step.

Scott Barry
SBBWorks, Inc.

11 data _null_;
12 retain idfiche 2222.2222;
13 idfichec = put(idfiche,17.);
14 putlog _all_;
15 run;

idfiche=2222.2222 idfichec=2222 _ERROR_=0 _N_=1
NOTE: DATA statement used (Total process time):
N/A
Posts: 0

Re: how to scribe my expression in EG ? item numeric to character

Super....Merci beaucoup !! çà marche bien...
Thank's
Respected Advisor
Posts: 4,138

Re: how to scribe my expression in EG ? item numeric to character

Hi pantalaimon
For me as a coder this was a learning experience.
What you have to do is replace your expression with:
PUT(TableName.idFiche ,17.)

The result of a PUT statement is always character - but you have to use a numeric format for numeric variables. Formats with a '$' are always for character variables.

Bonne chance
Patrick
N/A
Posts: 0

Re: how to scribe my expression in EG ? item numeric to character

Merci...
it's easy when explication is good ;o))

Best regards from France (Nice near Monaco !)
Respected Advisor
Posts: 4,138

Re: how to scribe my expression in EG ? item numeric to character

Sydney n'est pas mal non plus :-)

O.K. my French is a bit rusty.
Ask a Question
Discussion stats
  • 5 replies
  • 107 views
  • 0 likes
  • 3 in conversation