BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dhana
Fluorite | Level 6

Hi,

 

I have a requirement to create a thorn delimited text file. But I am not sure the delimiter option to be used in SAS to create one. 

 

Sample Output with thorn delimiter highlighted:-

 

vJ7kn75NEl9244XnTWigCla568eToDVIySAfOOMdZkg=þYyYFumWrrBabvEPu/n7cNmhlOVu/8Rx0p0lRsYbwA10=þ2018-06-30þ0þ77984845669þþIþBþþ*þMSCGþ0þþ2018-06-30þREGþRþRþþþAIþOþOAþþ2011-01-10þMþ68216084þ60þ278702499þ00þþþOþ31

 

Can someone help here. 

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

I think you're looking for 'FE'x. e.g.:

proc export data=sashelp.class dbms=dlm 
            outfile='/folders/myfolders/test.txt'
            replace;
  delimiter='FE'x;
run;

Art, CEO, AnalystFinder.com

 

View solution in original post

6 REPLIES 6
art297
Opal | Level 21

I think you're looking for 'FE'x. e.g.:

proc export data=sashelp.class dbms=dlm 
            outfile='/folders/myfolders/test.txt'
            replace;
  delimiter='FE'x;
run;

Art, CEO, AnalystFinder.com

 

dhana
Fluorite | Level 6
Thank you Art. This helps !
dhana
Fluorite | Level 6
data _null_;
set  SASHELP.CLASS end=EFIEOD; 
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
%let _EFIREC_ = 0;     /* clear export record count macro variable */
file '/folder/folder/class.txt' delimiter='þ' DSD DROPOVER lrecl=32767;
format Name $8. ;
format Sex $1. ;
format Age best12. ;
format Height best12. ;
format Weight best12. ;
if _n_ = 1 then do;
put
'Name'
'þ'
'Sex'
'þ'
'Age'
'þ'
'Height'
'þ'
'Weight'
;
end;
do;
EFIOUT + 1;
put Name $ @;
put Sex $ @;
put Age @;
put Height @;
put Weight ;
;
end;
if _ERROR_ then call symput('_EFIERR_',1);  /* set ERROR detection macro variable */
If EFIEOD then
call symput('_EFIREC_',EFIOUT);
run;

In between I built the above code and I am getting the same output. Do you expect any issues from the above code. ?

art297
Opal | Level 21

No! 

'þ' and 'FE'x

represent the same character.

 

Art, CEO, AnalystFinder.com

 

dhana
Fluorite | Level 6
Thanks Art !

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1227 views
  • 3 likes
  • 3 in conversation