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

I got it, thks.

You'll have to escuse me as it takes a while for me to write the answears so that the english errors are minimum!

And now the big doubt is... who gets the 4 points and who gets just 3. Smiley Happy

FriedEgg
SAS Employee

Use \s instead of \x00 to catch all 'white-space' characters and convert them to '40'x (@ in ascii)

filename tmp temp;

data _null_;

file tmp;

hex='000A0D3F250C00F2F4F6000A0D3F250C00F2F4F6000A0D3F250C00F2F4F6'x;

put hex;

run;

data foo;

infile tmp recfm=f lrecl=31 truncover; *this is 31 instead of 30 because of construction above in unix adds LF;

input @;

_infile_=prxchange('s/\s/@/',-1,_infile_);

input (v1-v30) ($ebcdic1.);

run;

PAzevedo
Fluorite | Level 6

I didn't quite get what you mean by 'white-space' characters. I see that it removes all the characters i mentioned before but not the '0C'x.

What is the difference?

FriedEgg
SAS Employee

Whitespace character information:

http://en.wikipedia.org/wiki/White_space_(computer_science)

I am not sure why it seems to be not including some of them in this case.

data foo;

infile tmp recfm=f lrecl=31 truncover; *this is 31 instead of 30 because of construction above in unix adds LF;

input @;

_infile_=prxchange('s/[\x00\x0A\x0D\x3F\x25\x0C]/@/',-1,_infile_);

list;

input (v1-v30) ($ebcdic1.);

put (v1-v30) (10*3. /);

run;

  .  .  .  .  .  .  .  2  4  6

  .  .  .  .  .  .  .  2  4  6

  .  .  .  .  .  .  .  2  4  6

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                     

1         @@@@@@@òôö@@@@@@@òôö@@@@@@@òôö@


PAzevedo
Fluorite | Level 6

I got it.It was one google search away! Smiley Happy

I don't know if i can remove all 'white-spaces' for the same reason i've got to keep the '0C'x so that the data read before the new SAS App matches the one read after. I'll look into it a i'll for sure start looking a lot more into pearl.

Thks.

FriedEgg
SAS Employee

This is a great, SAS specific, resource for information about the regular expression metacharacters

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003288497.htm

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 20 replies
  • 12882 views
  • 6 likes
  • 4 in conversation