SAS Mainframe ASA Carriage Control Behaviour
04:46 10 Dec 2025

I am currently working on SAS conversion to python. I noticed that there are ASA Carriage Control Character at the first column in the output file in mainframe. After some research, I noticed that 1 indicates new page, 0 indicates double space line and - indicates triple space line.

I also noticed that each PUT is similar to newline

The problem I am facing now is

  1. I am not sure if when the page length is 60, will it add a ‘1’ and move to next page

  2. Blank lines created using PUT statement are not displaying in my output file

For example I have this

PUT @1 ‘TEXT’
PUT;PUT;
PUT;PUT;
PUT;PUT;
PUT;PUT;
PUT;PUT;
PUT @1 ‘TEXT’

After reaching 60 lines, it will insert a carriage control character '1'. My line 60 is indicated below.

PUT @1 ‘TEXT’
PUT;PUT;
PUT;PUT;
PUT;PUT;       <- new page after this line
PUT;PUT;
PUT;PUT;
PUT @1 ‘TEXT’

So from my observation, 3 PUT statement will become a '-' and 2 PUT statement will become a '0'.

So what I expect is actually like this:

 TEXT
-
-
-
0TEXT

But I got this instead

TEXT
-
 TEXT

Apparently this is how it became

PUT @1 ‘TEXT’
PUT;PUT;       <- removed
PUT;PUT;       <- removed
PUT;PUT;       <- new page after this line
PUT;           <- removed
PUT;
PUT;PUT;
PUT @1 ‘TEXT’

I was wondering if there are any reason behind it. This is a SAS program being executed in a JCL from Mainframe. It is the first time I touched this so hope someone is able to help. I could not reproduce or paste the complete code as it is actually a company code TT.

sas mainframe carriage-return