Date: Tue, 10 Aug 2004 08:26:31 -0700
Reply-To: shiling zhang <shiling99@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: shiling zhang <shiling99@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: merging datafiles without using named datasets
Content-Type: text/plain; charset=ISO-8859-1
It may be easier to fix it under a text editor. Don't you think?
rune@fastlane.no (Rune Runnestoe) wrote in message news:<24410121.0408092259.17dee232@posting.google.com>...
> Hi,
> I am trying to fix a hurted file of 55092 records. The injury is a
> dislocation of 3 positions to the left in record # 36011.
>
> By running the code below, I manage to make to nice files. The idea is
> to solve the problem of dislocation by concatenating these two files
> in a third datastep, so that the file 'goodfile' will contain 55092
> records.
>
>
> filename badfile 's:\fremkon\r03-innra.dat';
> filename fixed_1 'D:\TEST\fixed_files\fixed_1.dat';
> filename fixed_2 'D:\TEST\fixed_files\fixed_2.dat';
> filename goodfile 'd:\test\fixed_ok.dat';
>
> data _null_;
> infile badfile lrecl=407;
> file fixed_1 lrecl=407;
> input;
> if _n_ <= 36010 then put _infile_;
> run;
>
> data _null_;
> infile badfile lrecl=407;
> file fixed_2 lrecl=407;
> input;
> if _n_ > 36010 then put _infile_;
> run;
>
> Can anyone suggest a code to concatenate the two part-datafiles to one
> without going through a named datastep (use rather data _null_; ....;
> run;) ?
>
>
>
> This doesn't work:
> data _null_;
> infile fixed_1 lrecl=407;
> infile fixed_2 lrecl=407;
> file goodfile lrecl=407;
> input;
> run;
>
> And neither does this:
> data _null_;
> infile fixed_1 fixed_2 lrecl=407;
> file goodfile lrecl=407;
> input;
> run;
|