The Esc characters \n, \r and \r\n are specific to C# and do not mean anything to COBOL. In COBOL you can use hex constants to define these characters for example X"0D" for carriage return and X"0A" for line feed. Here is an example that works in COBOL: working-storage section. 78 CR value X"0D". 01 myfield pic x(10). procedure division. declare s1 = "test" & CR declare s2 = s1::Replace(CR, type System.Environment::NewLine) move s2 to myfield display myfield
↧