LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 6 Nov 2002 20:19:23 GMT
Reply-To:     evan.cooch@NOSPAMCORNELL.EDU
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         evan.cooch@NOSPAMCORNELL.EDU
Organization: Cornell University
Subject:      Re: input problem | text block | single variable

On Wed, 06 Nov 2002 19:21:17 GMT, evan.cooch@NOSPAMcornell.edu wrote:

>On 6 Nov 02 19:04:36 GMT, Brian.Shilling@ASTRAZENECA.COM (Shilling, >Brian) wrote: > >>If you know the maximum length, you can try something >>like this: >> >> >> infile '<filename>' >> MISSOVER >> DSD >> lrecl=32767; >> >> format raw_name $varying801.; >> informat raw_name $varying801.; >> >> >> input raw_name $; >> >> >>You could replace the 801 with the length of the entire string. >> > >Worth a try - fuynny, but after 20+ years of using SAS, this is the >first time I've ever had to input data of this sort. >

Above doesn't work.

Consider the following code (derived from above):

data test; infile cards MISSOVER DSD LRECL=32767; format fragment $varying154.; informat fragment $varying154.; input fragment $; cards; GACGGGTCGTTTCAGCTGAA

BSGDGASTTSTSTSTSTEND *;

This still gives me 2 records for the variable fragment. I want fragment to simply be

GACGGGTCGTTTCAGCTGAABSGDGASTTSTSTSTSTEND

I've tried using TRUNCOVER, but that doesn't work either.

But, if I do

options linesize=80;

data test;

infile cards;

length fragment $40 frag1 $20 frag2 $20;

input #1 frag1 $

#2 frag2 $;

fragment=frag1||frag2;

cards;

GACGGGTCGTTTCAGCTGAA

BSGDGASTTSTSTSTSTEND

*;

proc print;

run;

it works fine. The problem is, its cumbersome, especially since the actual fragment I need to build this way is 24,00 characters long, and is split over ~ 600 lines in the data file.


Back to: Top of message | Previous page | Main SAS-L page