Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to construct the string ID ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jack Clark  
View profile  
 More options Apr 23 2008, 8:49 am
Newsgroups: comp.soft-sys.sas
From: JCl...@CHPDM.UMBC.EDU (Jack Clark)
Date: Wed, 23 Apr 2008 08:49:54 -0400
Local: Wed, Apr 23 2008 8:49 am
Subject: Re: How to construct the string ID ?
Irin,

=20

This assumes no missing characters in the ID structure you described and
no names less than 5 characters.

=20

data _null_;

length id2 $12;

id =3D 'LOLOBRIDGIDA195703F';

id2 =3D substr(id,1,5)||reverse((substr(reverse(id),1,7)));

put _all_;

run;

=20

=20

Jack Clark

Research Analyst

Center for Health Program Development and Management

University of Maryland, Baltimore County

=20

________________________________

From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of
Irin later
Sent: Wednesday, April 23, 2008 8:36 AM
To: SA...@LISTSERV.UGA.EDU
Subject: How to construct the string ID ?

=20

 I have ID that includes a name, year of birth, month of birch an gender

LOLOBRIDGIDA195703F

=20

I need to construct id  of just 5 letters of that first name and the
rest of the ID above:

LOLOB195703F

=20

How can I implement it with a code (I mean all names has different
length)?

=20

Thank you in advance,

=20

Irin

=20

________________________________

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=3D51733/*http:/mobile.yahoo.com/;_ylt=3DAh...
i62
sR8HDtDypao8Wcj9tAcJ%20> =20


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Dorfman  
View profile  
 More options Apr 23 2008, 8:51 am
Newsgroups: comp.soft-sys.sas
From: sash...@BELLSOUTH.NET (Paul Dorfman)
Date: Wed, 23 Apr 2008 12:51:28 +0000
Local: Wed, Apr 23 2008 8:51 am
Subject: Re: How to construct the string ID ?
 Irin,

Try GINA1 :). Now seriously (untested),

NewID = cats (substr (ID, 1, 5), substr (ID, anydigit (ID)) ;

Kind regards
------------
Paul Dorfman
Jax, FL
------------

  -------------- Original message from Irin later <irinfig...@YAHOO.COM>: --------------

 I have ID that includes a name, year of birth, month of birch an gender
LOLOBRIDGIDA195703F

I need to construct id  of just 5 letters of that first name and the rest of the ID above:
LOLOB195703F

How can I implement it with a code (I mean all names has different length)?

Thank you in advance,

Irin
      Be a better friend, newshound, andknow-it-all with Yahoo! Mobile.  Try it now.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Irin later  
View profile  
 More options Apr 23 2008, 8:35 am
Newsgroups: comp.soft-sys.sas
From: irinfig...@yahoo.com (Irin later)
Date: Wed, 23 Apr 2008 05:35:39 -0700
Local: Wed, Apr 23 2008 8:35 am
Subject: How to construct the string ID ?
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'><DIV id=yiv1114131686>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3> </FONT><FONT face="Times New Roman" size=3>I have ID that includes a name, year of birth, month of birch an gender</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>LOLOBRIDGIDA195703F</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3></FONT> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>I need to construct id<SPAN>  </SPAN>of just 5 letters of that first name and the rest of the ID above:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>LOLOB195703F</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>How can I implement it with a code (I mean all names has different length)?</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>Thank you in advance,</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face="Times New Roman">Irin</FONT></FONT></P></DIV></td></tr></table><br>

      <hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06... "> Try it now.</a>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Wooding  
View profile  
 More options Apr 23 2008, 8:54 am
Newsgroups: comp.soft-sys.sas
From: Nathaniel.Wood...@DOM.COM (Nat Wooding)
Date: Wed, 23 Apr 2008 08:54:08 -0400
Local: Wed, Apr 23 2008 8:54 am
Subject: Re: How to construct the string ID ?
Irin

You could write this out in one statement but I find it easier to
understand and follow if I see the parts.

Data newid;

string ='LOLOBRIDGIDA195703F';

name   = substr( string , 1 , 5 );           * extract five letters of the
name;
string = reverse( string );                  * reverse the string so that
you may read from the right;
stats  = reverse( substr( string , 1 , 7 )); * read the needed info and
reverse;
newid  = compress( name || stats) ;          * create the new variable;
Drop stats name;
run;

Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977

             Irin later
             <irinfigvam@YAHOO
             .COM>                                                      To
             Sent by: "SAS(r)          SA...@LISTSERV.UGA.EDU
             Discussion"                                                cc
             <SA...@LISTSERV.U
             GA.EDU>                                               Subject
                                       How to construct the string ID ?

             04/23/2008 08:35
             AM

             Please respond to
             irinfigvam@yahoo.
                    com

  I have ID that includes a name, year of birth, month of birch an gender
 LOLOBRIDGIDA195703F

 I need to construct id  of just 5 letters of that first name and the rest
 of the ID above:
 LOLOB195703F

 How can I implement it with a code (I mean all names has different
 length)?

 Thank you in advance,

 Irin

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.

-----------------------------------------
CONFIDENTIALITY NOTICE:  This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect.  The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized.  If you are not the intended
recipient, any disclosure,  copying, distribution, or use of the
contents of this information is prohibited and may be unlawful.  If
you have received this electronic  transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it.  Thank you.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Irin later  
View profile  
 More options Apr 23 2008, 9:14 am
Newsgroups: comp.soft-sys.sas
From: irinfig...@yahoo.com (Irin later)
Date: Wed, 23 Apr 2008 06:14:56 -0700
Local: Wed, Apr 23 2008 9:14 am
Subject: Re: How to construct the string ID ?
<table cellspacing=3D'0' cellpadding=3D'0' border=3D'0' ><tr><td style=3D'f=
ont: inherit;'><P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT fac=
e=3D"Times New Roman" size=3D3>Jack, I do not have spaces, but scenarion wi=
th less than 5 letters did not even  come to my mind .It actually can=
=E2=80=A6.</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><?xml:namespace prefix =
=3D o ns =3D "urn:schemas-microsoft-com:office:office" /><o:p><FONT face=3D=
"Times New Roman" size=3D3> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3D"Times New =
Roman" size=3D3>Is it possible to do it in such a case?</FONT></P><BR><BR>-=
-- On <B>Wed, 4/23/08, Jack Clark <I><JCl...@CHPDM.UMBC.EDU></I></B> =
wrote:<BR>
<BLOCKQUOTE style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(=
16,16,255) 2px solid">From: Jack Clark <JCl...@CHPDM.UMBC.EDU><BR>Sub=
ject: Re: How to construct the string ID ?<BR>To: SA...@LISTSERV.UGA.EDU<BR=

>Date: Wednesday, April 23, 2008, 8:49 AM<BR><BR><PRE>Irin,

=20

This assumes no missing characters in the ID structure you described and
no names less than 5 characters.

=20

data _null_;

length id2 $12;

id =3D 'LOLOBRIDGIDA195703F';

id2 =3D substr(id,1,5)||reverse((substr(reverse(id),1,7)));

put _all_;

run;

=20

=20

Jack Clark

Research Analyst

Center for Health Program Development and Management

University of Maryland, Baltimore County

=20

________________________________

From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of
Irin later
Sent: Wednesday, April 23, 2008 8:36 AM
To: SA...@LISTSERV.UGA.EDU
Subject: How to construct the string ID ?

=20

 I have ID that includes a name, year of birth, month of birch an gender

LOLOBRIDGIDA195703F

=20

I need to construct id  of just 5 letters of that first name and the
rest of the ID above:

LOLOB195703F

=20

How can I implement it with a code (I mean all names has different
length)?

=20

Thank you in advance,

=20

Irin

=20

________________________________

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=3D51733/*http:/mobile.yahoo.com/;_ylt=3DAhu0=
6i62
sR8HDtDypao8Wcj9tAcJ%20></PRE></BLOCKQUOTE></td></tr></table><br>=0A=0A =
     <hr size=3D1>Be a better friend, newshound, and =0Aknow-it-all with Ya=
hoo! Mobile. <a href=3D"http://us.rd.yahoo.com/evt=3D51733/*http://mobile.y=
ahoo.com/;_ylt=3DAhu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Howard Schreier  
View profile  
 More options Apr 23 2008, 9:26 am
Newsgroups: comp.soft-sys.sas
From: hs AT dc-sug DOT org ("Howard Schreier)"
Date: Wed, 23 Apr 2008 09:26:40 -0400
Local: Wed, Apr 23 2008 9:26 am
Subject: Re: How to construct the string ID ?
On Wed, 23 Apr 2008 09:22:30 -0400, Nat Wooding <Nathaniel.Wood...@DOM.COM>
wrote:

>If modified, Pauls code works nicely with fewer than five letters and an
>internal space

>Data newid;

>id ='L LO195703F';

>NewID = cats( compress( substr (ID, 1, 5) , '0123456789' ), substr (ID,
>anydigit (ID) )) ;
>put newid;
>run;

Or

   data _null_;
   do ID = 'Goodnight123456A', 'Sall234567B';
      NewID = cats (substr (ID, 1, min(anydigit (ID) - 1, 5) )
                    , substr (ID, anydigit (ID) ) );
      put id= newid=;
      end;
   run;


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nat Wooding  
View profile  
 More options Apr 23 2008, 9:22 am
Newsgroups: comp.soft-sys.sas
From: Nathaniel.Wood...@DOM.COM (Nat Wooding)
Date: Wed, 23 Apr 2008 09:22:30 -0400
Local: Wed, Apr 23 2008 9:22 am
Subject: Re: How to construct the string ID ?
If modified, Pauls code works nicely with fewer than five letters and an
internal space

Data newid;

id ='L LO195703F';

NewID = cats( compress( substr (ID, 1, 5) , '0123456789' ), substr (ID,
anydigit (ID) )) ;
put newid;
run;

Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977

             Irin later
             <irinfigvam@YAHOO
             .COM>                                                      To
             Sent by: "SAS(r)          SA...@LISTSERV.UGA.EDU
             Discussion"                                                cc
             <SA...@LISTSERV.U
             GA.EDU>                                               Subject
                                       Re: How to construct the string ID
                                       ?
             04/23/2008 09:14
             AM

             Please respond to
             irinfigvam@yahoo.
                    com

 Jack, I do not have spaces, but scenarion with less than 5 letters did not
 even  come to my mind .It actually can….

 Is it possible to do it in such a case?

 --- On Wed, 4/23/08, Jack Clark <JCl...@CHPDM.UMBC.EDU> wrote:
  From: Jack Clark <JCl...@CHPDM.UMBC.EDU>
  Subject: Re: How to construct the string ID ?
  To: SA...@LISTSERV.UGA.EDU
  Date: Wednesday, April 23, 2008, 8:49 AM

  Irin,

  This assumes no missing characters in the ID structure you described and
  no names less than 5 characters.

  data _null_;

  length id2 $12;

  id = 'LOLOBRIDGIDA195703F';

  id2 = substr(id,1,5)||reverse((substr(reverse(id),1,7)));

  put _all_;

  run;

  Jack Clark

  Research Analyst

  Center for Health Program Development and Management

  University of Maryland, Baltimore County

  ________________________________

  From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of
  Irin later
  Sent: Wednesday, April 23, 2008 8:36 AM
  To: SA...@LISTSERV.UGA.EDU
  Subject: How to construct the string ID ?

   I have ID that includes a name, year of birth, month of birch an gender

  LOLOBRIDGIDA195703F

  I need to construct id  of just 5 letters of that first name and the
  rest of the ID above:

  LOLOB195703F

  How can I implement it with a code (I mean all names has different
  length)?

  Thank you in advance,

  Irin

  ________________________________

  Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
  it now.
  <http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62
  sR8HDtDypao8Wcj9tAcJ%20>

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.
-----------------------------------------
CONFIDENTIALITY NOTICE:  This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect.  The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized.  If you are not the intended
recipient, any disclosure,  copying, distribution, or use of the
contents of this information is prohibited and may be unlawful.  If
you have received this electronic  transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it.  Thank you.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Keintz, H. Mark"  
View profile  
 More options Apr 23 2008, 11:27 am
Newsgroups: comp.soft-sys.sas
From: mkei...@WHARTON.UPENN.EDU ("Keintz, H. Mark")
Date: Wed, 23 Apr 2008 11:27:58 -0400
Local: Wed, Apr 23 2008 11:27 am
Subject: Re: How to construct the string ID ?
The elegant substr(ID,anydigit) technique proposed by Paul and modified by Howard also assumes no one has a numeric character in their name.  Want to bet on that?

If you don't, then you have to go to the more ugly approach of explicitly extracting the last 7 characters (the "YYYYMMX" at the end).  This function will deal with that.

    newid2 = cats(   substr(id,1,min(length(id)-7,4))
                    ,substr(id,length(id)-6)
                 );

I'd also suggest that you might want all the NEWID's to have the same length, which won't happen with short names.  In that case, let's say you want to put an underscore as a filler whenever the name part of the id is too short.  Which would introduce the complications in this version:

  newid3 =  cats(  substr(cats(substr(id,1,min(length(id)-7,5)),'____'),1,5)
                  ,substr(id,length(id)-6)
                );


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"data _null_,"  
View profile  
 More options Apr 23 2008, 4:08 pm
Newsgroups: comp.soft-sys.sas
From: datan...@GMAIL.COM ("data _null_,")
Date: Wed, 23 Apr 2008 15:08:19 -0500
Local: Wed, Apr 23 2008 4:08 pm
Subject: Re: How to construct the string ID ?
Seems like you can take advantage of the fact the the part at the end
is constant length.  YYYYMMG.
I would also suggest that any ID less than length 12 needs no
modification.  But I include at bit of code that to address that
situation that seems adequate in belated offering.

459  data _null_;
460     length id ref $50;
461     input id @1 ref;
462     if length(id) gt 12 then substr(id,6)=substr(id,length(id)-6);
463     else id =
subpad(substr(id,1,length(id)-7),1,5)||substr(id,length(id)-6);
464     put (_all_)(:);
465     cards;

LOLOB195703F LOLOBRIDGIDA195703F
DudeB200804M DudeBornYesterday200804M
Dude 200804M Dude200804M
Du   200804M Du200804M

On Wed, Apr 23, 2008 at 8:26 AM, Howard Schreier <hs AT dc-sug DOT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Irin later  
View profile  
 More options May 1 2008, 1:47 pm
Newsgroups: comp.soft-sys.sas
From: irinfig...@yahoo.com (Irin later)
Date: Thu, 1 May 2008 10:47:13 -0700
Local: Thurs, May 1 2008 1:47 pm
Subject: Re: How to construct the string ID ?
<table cellspacing=3D'0' cellpadding=3D'0' border=3D'0' ><tr><td style=3D'f=
ont: inherit;'><P>A this time I have newid   (name+year+month+day=
+gender) r example ADAM19480204M</P>
<P>I need to rebuild it in order it looks like:</P>
<P> </P>
<P>    ADAM194802M</P>
<P>(Name can vary up to 5 letters)</P>
<P> </P>
<P>In other words I  need to take out  DAY part.</P>
<P> </P>
<P>Could you give me a hand ,please , with this code?</P>
<P> </P>
<P>Thank you in advance,</P>
<P> </P>
<P>Irin</P>
<P> </P>
<P><BR><BR>--- On <B>Wed, 4/23/08, Nathaniel.Wood...@dom.com <I><Nathani=
el.Wood...@dom.com></I></B> wrote:<BR></P>

<BLOCKQUOTE style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(=
16,16,255) 2px solid">From: Nathaniel.Wood...@dom.com <Nathaniel.Wooding=
@dom.com><BR>Subject: Re: How to construct the string ID ?<BR>To: irinfi=
g...@yahoo.com<BR>Cc: SA...@LISTSERV.UGA.EDU<BR>Date: Wednesday, April 23, =
2008, 9:22 AM<BR><BR><PRE>If modified, Pauls code works nicely with fewer t=
han five letters and an
internal space

Data newid;

id =3D'L LO195703F';

NewID =3D cats( compress( substr (ID, 1, 5) , '0123456789' ), substr
(ID,
anydigit (ID) )) ;
put newid;
run;

Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977

                                                                          =
=20
             Irin later                                                   =
=20
             <irinfigvam@YAHOO                                          =
  =20
             .COM>                                                      =
To=20
             Sent by: "SAS(r)          SA...@LISTSERV.UGA.EDU            =
=20

             Discussion"                                                cc

             <SA...@LISTSERV.U                                          =
  =20
             GA.EDU>                                               Subje=
ct=20
                                       Re: How to construct the string ID =
=20
                                       ?                                  =
=20
             04/23/2008 09:14                                             =
=20
             AM                                                           =
=20
                                                                          =
=20
                                                                          =
=20
             Please respond to                                            =
=20
             irinfigvam@yahoo.                                            =
=20
                    com                                                   =
=20
                                                                          =
=20
                                                                          =
=20

                                                                           =
=20
 Jack, I do not have spaces, but scenarion with less than 5 letters did not=
=20
 even  come to my mind .It actually can=E2=80=A6.                          =
        =20
                                                                           =
=20
 Is it possible to do it in such a case?                                   =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
 --- On Wed, 4/23/08, Jack Clark <JCl...@CHPDM.UMBC.EDU> wrote:      =
   =20
 =20
  From: Jack Clark <JCl...@CHPDM.UMBC.EDU>                           =
   =20
 =20
  Subject: Re: How to construct the string ID ?                            =
=20
  To: SA...@LISTSERV.UGA.EDU                                               =
=20
  Date: Wednesday, April 23, 2008, 8:49 AM                                 =
=20
                                                                           =
=20
  Irin,                                                                    =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  This assumes no missing characters in the ID structure you described and =
=20
  no names less than 5 characters.                                         =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  data _null_;                                                             =
=20
                                                                           =
=20
  length id2 $12;                                                          =
=20
                                                                           =
=20
  id =3D 'LOLOBRIDGIDA195703F';                                         =20
   =20
                                                                           =
=20
  id2 =3D substr(id,1,5)||reverse((substr(reverse(id),1,7)));              =
  =20
                                                                           =
=20
  put _all_;                                                               =
=20
                                                                           =
=20
  run;                                                                     =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  Jack Clark                                                               =
=20
                                                                           =
=20
  Research Analyst                                                         =
=20
                                                                           =
=20
  Center for Health Program Development and Management                     =
=20
                                                                           =
=20
  University of Maryland, Baltimore County                                 =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  ________________________________                                         =
=20
                                                                           =
=20
  From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of     =
=20
  Irin later                                                               =
=20
  Sent: Wednesday, April 23, 2008 8:36 AM                                  =
=20
  To: SA...@LISTSERV.UGA.EDU                                               =
=20
  Subject: How to construct the string ID ?                                =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
   I have ID that includes a name, year of birth, month of birch an gender =
=20
                                                                           =
=20
  LOLOBRIDGIDA195703F                                                      =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  I need to construct id  of just 5 letters of that first name and the     =
=20
  rest of the ID above:                                                    =
=20
                                                                           =
=20
  LOLOB195703F                                                             =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  How can I implement it with a code (I mean all names has different       =
=20
  length)?                                                                 =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  Thank you in advance,                                                    =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  Irin                                                                     =
=20
                                                                           =
=20
                                                                           =
=20
                                                                           =
=20
  ________________________________                                         =
=20
...

read more »


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Irin later  
View profile  
 More options May 1 2008, 2:49 pm
Newsgroups: comp.soft-sys.sas
From: irinfig...@yahoo.com (Irin later)
Date: Thu, 1 May 2008 11:49:20 -0700
Local: Thurs, May 1 2008 2:49 pm
Subject: Re: How to construct the string ID ?
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'><P>Paul, but I do not see the new id!!!!</P>
<P> </P>
<P>Fin has just Gender letter! I am not sure if I properly explained the issue</P>
<P> </P>
<P>This is my old id</P>
<P> </P>
<P>ADAM19480204M</P>
<P>This should be my new id </P>
<P>ADAM194802M (Short one without "04" - day):</P>
<P> </P>
<P> </P>
<P>SESIL20071210F </P>
<P>SESIL200712F (short one without "10" - day):</P>
<P> </P>
<P>Sesil name is longer (5 letters)</P>
<P><BR><BR>--- On <B>Thu, 5/1/08, Paul St Louis <I><pstl...@DOT.STATE.TX.US></I></B> wrote:<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Paul St Louis <pstl...@DOT.STATE.TX.US><BR>Subject: Re: How to construct the string ID ?<BR>To: SA...@LISTSERV.UGA.EDU<BR>Date: Thursday, May 1, 2008, 2:28 PM<BR><BR><PRE>Hi Irin,

I am using Windows XP and SAS 9.1...I think this might get what you want.

Data Have;
  Input @1 Old $14.;

Datalines;
Adam19480204m
Stlo19620408m
;

Data Need (Drop = Temp1 Temp2 New);
  Length New $14.;
  Set Have;
  Temp1 = Left(Reverse(Old));
  Sex   = Substr(Temp1,1,1);
  Temp2 = Substr(Temp1,4,10);
  New   = Reverse(Temp2);
  Fin   = Cats(New,Sex);
Run;

Proc Print;
Var Old Fin Sex;
Run;

On Thu, 1 May 2008 10:47:13 -0700, Irin later <irinfig...@YAHOO.COM>
wrote:

><table cellspacing='0' cellpadding='0'

border='0' ><tr><td style='font:
inherit;'><P>A this time I have newid&nbsp;&nbsp;
(name+year+month+day+gender) r example ADAM19480204M</P>

><P>I need to rebuild it in order it looks like:</P>
><P>&nbsp;</P>
><P>&nbsp;&nbsp;&nbsp; ADAM194802M</P>
><P>(Name can vary up to 5 letters)</P>
><P>&nbsp;</P>
><P>In other words I&nbsp; need to take&nbsp;out &nbsp;DAY
part.</P>
><P>&nbsp;</P>
><P>Could you give me a hand ,please , with this code?</P>
><P>&nbsp;</P>
><P>Thank you in advance,</P>
><P>&nbsp;</P>
><P>Irin</P>
><P>&nbsp;</P></PRE></BLOCKQUOTE></td></tr></table><br>

      <hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06... "> Try it now.</a>

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul St Louis  
View profile  
 More options May 1 2008, 2:57 pm
Newsgroups: comp.soft-sys.sas
From: pstl...@DOT.STATE.TX.US (Paul St Louis)
Date: Thu, 1 May 2008 14:57:06 -0400
Local: Thurs, May 1 2008 2:57 pm
Subject: Re: How to construct the string ID ?
I will need to see your code. I suspect it involves failing to use the left
trim function, as in

  Temp1 = Left(Reverse(Old));

and you are not trimming the temp1 variable. In that case, you would only
see the sex.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul St Louis  
View profile  
 More options May 1 2008, 2:28 pm
Newsgroups: comp.soft-sys.sas
From: pstl...@DOT.STATE.TX.US (Paul St Louis)
Date: Thu, 1 May 2008 14:28:03 -0400
Local: Thurs, May 1 2008 2:28 pm
Subject: Re: How to construct the string ID ?
Hi Irin,

I am using Windows XP and SAS 9.1...I think this might get what you want.

Data Have;
  Input @1 Old $14.;

Datalines;
Adam19480204m
Stlo19620408m
;

Data Need (Drop = Temp1 Temp2 New);
  Length New $14.;
  Set Have;
  Temp1 = Left(Reverse(Old));
  Sex   = Substr(Temp1,1,1);
  Temp2 = Substr(Temp1,4,10);
  New   = Reverse(Temp2);
  Fin   = Cats(New,Sex);
Run;

Proc Print;
Var Old Fin Sex;
Run;

On Thu, 1 May 2008 10:47:13 -0700, Irin later <irinfig...@YAHOO.COM> wrote:
><table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font:

inherit;'><P>A this time I have newid&nbsp;&nbsp;
(name+year+month+day+gender) r example ADAM19480204M</P>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul St Louis  
View profile  
 More options May 1 2008, 3:24 pm
Newsgroups: comp.soft-sys.sas
From: pstl...@DOT.STATE.TX.US (Paul St Louis)
Date: Thu, 1 May 2008 15:24:33 -0400
Local: Thurs, May 1 2008 3:24 pm
Subject: Re: How to construct the string ID ?
It's been very busy around here, but I should explain the code a little bit
more. The code that I wrote is reversing the order of the variable and
trimming it down.

 Temp1 = Left(Reverse(Old));

Next, isolate M or F.

 Sex   = Substr(Temp1,1,1);

Now skip 4 characters over and read the rest

 Temp2 = Substr(Temp1,4,10);

Now place it back in the original order (could have said temp2 = reverse
(temp2), but wanted to break out the process so you could see it)

 New   = Reverse(Temp2);

Use Cats to remove leading and trailing blanks and || together the two
variables into one

 Fin   = Cats(New,Sex);

Clear as mud?

>>> Irin later <irinfig...@yahoo.com> 05/01/2008 1:49 PM >>>

Paul, but I do not see the new id!!!!

Fin has just Gender letter! I am not sure if I properly explained the issue

This is my old id

ADAM19480204M
This should be my new id
ADAM194802M (Short one without "04" - day):

SESIL20071210F
SESIL200712F (short one without "10" - day):

Sesil name is longer (5 letters)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google