🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 09-29-2018 02:26 AM
(943 views)
Hi
I have a data like this.
Data abc;
Input name $10. mail $20. Age 2.;
Infile datalines dlm='@';
abc@mas@gmail.com@12
Absh@auuaa@gmail.com@17
asaks@ajhsjk@gmail.com@18
;
Run;
I want output like this
name mail. age
abc mas@gmail.com 12
absh auuaa@gmail.com 17
asaks ajhsjk@gmail.com 18
Thanks in advance
- Tags:
- Delimeter
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Read separately, and concatenate:
data abc;
infile datalines dlm='@';
input name :$10. mail :$64. _mail :$32. age;
mail = catx('@',mail,_mail);
drop _mail;
datalines;
abc@mas@gmail.com@12
Absh@auuaa@gmail.com@17
asaks@ajhsjk@gmail.com@18
;
run;
Note that using formats without a colon overrides the delimiters.
PS use proper subjects. "base sas" is much too unspecific.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Read separately, and concatenate:
data abc;
infile datalines dlm='@';
input name :$10. mail :$64. _mail :$32. age;
mail = catx('@',mail,_mail);
drop _mail;
datalines;
abc@mas@gmail.com@12
Absh@auuaa@gmail.com@17
asaks@ajhsjk@gmail.com@18
;
run;
Note that using formats without a colon overrides the delimiters.
PS use proper subjects. "base sas" is much too unspecific.