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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 save with the early bird rate—just $795!
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.