BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I have the below piece of code,

%MACRO COPYREP(RNAME);
DATA OMDATA;
FILENM=&RNAME;
INFILE DUMMY FILEVAR=FILENM END=DONE MISSOVER LENGTH=LINELEN;
DO WHILE (NOT DONE);
INPUT @1 REC $VARYING200. LINELEN;
OUTPUT;
END;

DATA _NULL_;
SET OMDATA;
FBREC = SUBSTR(REC,2,133);
FILE OUT1 NOTITLES NOPRINT;
PUT @1 FBREC $CHAR133.;
%MEND;

Now the problem is SAS LOG says,

69161 RECORDS WERE WRITTEN TO THE FILE OUT1.
THERE WERE 69161 OBSERVATIONS READ FROM THE DATA SET WORK.OMDATA.

But when I actually check the output file, it contains lesser number of records (68010).

When I increase the space of the file OUT1 and run the code, it works fine. But my question is, if there was not enough space in the output file, it should have produced an error, but it is not. Please advise.
6 REPLIES 6
Peter_C
Rhodochrosite | Level 12
are you running SAS on z/OS?
Peter_C
Rhodochrosite | Level 12
then provide a bit more log information, even the jes joblog [which is where I imaging a B37 equivalent "out-of-space" message might appear.]
Robert_Bardos
Fluorite | Level 6
You are making this way too hard. If your goal is to get rid of the print control character in column one use something like this:
[pre]
data _null_ ;
infile report print ;
file outfile noprint ;
input ;
put _infile_ ;
run ;
[/pre]
deleted_user
Not applicable
It does not produce any error, is what is the problem.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
To gain assistance from this forum, you will be best served by revealing all SAS code executed, in the form of your "complete" SAS-generated log output pasted into your post-reply. Or possibly ask a colleague to offer another set of eyes into reviewing your problem/error, as an alternative.

Also, consider browsing each of your files, side-by-side, to identify at what point in the file you do or do not see what you expect in the output file.

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 778 views
  • 0 likes
  • 4 in conversation