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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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