BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

The asterisks will appear when you use formatted printing when the numeric value is invalid for the format specification used.  For example there is no way to represent values larger than 99 with only two digits.  So if you print 123 using 2. format you will get **.  And you will get a note in the log about it.  Example:

368  data _null_;
369    x=123;
370    put x 2.;
371  run;

**
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

In addition to the two notes you posted that show the number of observations read and lines written you should also see notes about how long the shortest and longest line was.  Example:

345  data _null_;
346    file text;
347    set sashelp.class;
348    put name sex age ;
349  run;

NOTE: The file TEXT is:
      Filename=xxx,
      RECFM=V,LRECL=32767,File Size (bytes)=0,
      Last Modified=13Nov2024:09:19:56,
      Create Time=13Nov2024:09:19:56

NOTE: 19 records were written to the file TEXT.
      The minimum record length was 9.
      The maximum record length was 12.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
      real time           0.08 seconds
      cpu time            0.03 seconds

Notice

      The minimum record length was 9.
      The maximum record length was 12.

How are you LOOKING at the text file?  Since you are writing lines that over 200 bytes long if you just type the file to a terminal the lines will wrap.

 

Did you try reading it with SAS?  Again note that SAS will display in the log the min and max lengths of the lines read from the file in addition to the number of lines.  Did SAS find 11 lines when it read the file.

 

There are only two ways a single PUT statement (without / or # cursor motion commands) could write more than one line.  Either the text being written includes line breaks.  In that case you will only notice the difference when you read back in the file.

 

Or the lines being written are longer than the record length being used by the FILE statement which will cause the PUT statement to move to a new line.  But that case you will see a different number of lines written than observations read when checking the LOG from the data step that wrote the file.

363  data _null_;
364    file text lrecl=30;
365    set sashelp.class(obs=3);
366    put name sex @35 age ;
367  run;

NOTE: The file TEXT is:
      Filename=xxx,
      RECFM=V,LRECL=30,File Size (bytes)=0,
      Last Modified=13Nov2024:09:31:02,
      Create Time=13Nov2024:09:31:02

NOTE: 6 records were written to the file TEXT.
      The minimum record length was 2.
      The maximum record length was 9.
NOTE: There were 3 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

 

animesh123
Obsidian | Level 7
yep I am getting the same output ,but the MIN rec length and MAX is same
NOTE: 11 records were written to the file '$CURRPATH/YGRT010.txt'.
The minimum record length was 2119.
The maximum record length was 2119.
NOTE: There were 11 observations read from the data set WORKDIR.RPLPRNLN010_FINAL.
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 3086 views
  • 0 likes
  • 6 in conversation