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.
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;
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?
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 @@@@@@@òôö@@@@@@@òôö@@@@@@@òôö@
I got it.It was one google search away!
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.
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.