Hi Experts,
I am trying to substitute line feed to my character variable, in place of a pattern. I have used following attempts.
Please help.
Ref:
https://communities.sas.com/t5/SAS-Procedures/SAS-new-line-symbol-character-code/td-p/27843
Translate replaces characters from the list with equivalent characters from the replace list, not the whole word. Tranwrd is the tool for replacing a whole text string with something else. Per the manual:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000215153.htm
The prx is simply replacing the text string with the text string /n as you say, and that is correct. The /n means newline in some file formats,much like ^{newline} can be used in rtf code. Therefore the code is working, but your output renderer (rtf, pdf etc.) is either not setup to use the /n syntax, or its not valid for that renderer.
Use:
itemdata_value=tranwrd(itemdata_value,"XXXXXXXX",'0a'x);
Translate replaces characters from the list with equivalent characters from the replace list, not the whole word. Tranwrd is the tool for replacing a whole text string with something else. Per the manual:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000215153.htm
The prx is simply replacing the text string with the text string /n as you say, and that is correct. The /n means newline in some file formats,much like ^{newline} can be used in rtf code. Therefore the code is working, but your output renderer (rtf, pdf etc.) is either not setup to use the /n syntax, or its not valid for that renderer.
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.