Hello,
Can anybody tell me , What is the pound sign used for in the DATA _NULL_?
Regards,
Jaiganesh
data _null_;
file print;
put @1 'Hello'
#6 @5 'World!';
run;
produces:
Cynthia
One place you may find the pound sign (#) in a data step (_null_ or other) is in an input statement, where it is used as a line pointer control.
It is not restricted to data _null_ code.
Generally it would refer to a line or record of the file accessible to an input statement.
It interacts with the N= option on an INFILE statement.
If you are asking the question, there are likely a lot of details that you need to learn first. Just addressing the question itself ...
In a data _NULL_ step, the pound sign is typically used when the purpose of the DATA step is to generate some sort of text file using PUT statements. The text file is often a report, but could conceivably be a data file.
The pound sign appears within a PUT statement with a number immediately following. That number indicates which line number the PUT statement should write to.
data _null_;
file print;
put @1 'Hello'
#6 @5 'World!';
run;
produces:
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.