Date: Fri, 26 Sep 2003 15:36:19 -0700
Reply-To: Kumar <kamur@LYCOS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kumar <kamur@LYCOS.COM>
Organization: http://groups.google.com/
Subject: Re: Sorting Using SAS
Content-Type: text/plain; charset=ISO-8859-1
Hello Charles,
Thanks for the solution and seems like it is working.
I have SAS MVS though and I want the outputs to be in a dataset. Right
now, it sorts and writes to a temporary workfile...Thatis what I can
see from my messages...
I am unable to see the output file...Any help on the MVS side of it to
make the sorted outputs come to a dataset?
Thanks
Kamur
charles_s_patridge@PRODIGY.NET (Charles Patridge) wrote in message news:<200309261445.h8QEjcE11990@listserv.cc.uga.edu>...
> Kamur,
>
> Try this. I think it does what you were looking for but then again, I
> could have misread your request -
>
> filename rawdata "c:\download\rawdata.txt";
> data test;
> length record $80 sort $ 7.;
> retain group sort;
> infile rawdata missover;
> input @1 code $4. @;
> if code = '0001' then do;
> seq = 0;
> group + 1;
> input @1 record ;
> sort = substr(record,5,3)|| substr(record,8,4);
> end;
> if code ne '0001' then input @1 record ;
> seq + 1;
> run;
> proc sort data=test out=testsort; by sort group seq; run;
>
>
> /*** rawdata.txt looks like this
> 0001AAA1111ASADFJA;DFJ -line1
> 0001CCC1122DAF'SDFK'SDKF -line2
> ADSAF'DKF'A;SDKF'AD;KFD -line3
> 0001BBB2222ADFASDFLJAD'KF -line4
> DADFA'DSFKA'SDKF'DKFDFD -line5
> ADFAKFD';LKDSF'AKSDFSDF -line6
> 0001DDD1111DADAFSAFDFF -line7
> ***/
>
> HTH,
> Charles Patridge
|