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 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 12 Nov 2000 20:17:36 GMT
Reply-To:     Roger Lustig <julierog@IX.NETCOM.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Roger Lustig <julierog@IX.NETCOM.COM>
Subject:      Re: Data Step Question
Content-Type: text/plain; charset=iso-8859-1

Andreas, we may be touching different parts of the same elephant!

Andreas Grueninger wrote: > > Roger Lustig <julierog@ix.netcom.com> wrote: > > Roger's solution creates another structure of the data set as used in > Anna's post.

Actually, I tried to get as close as possible!

> To get the same structure use the @ (or § in MVS) modifier of the > INPUT statement. > @ holds the line pointer in the record of the flat file. > And remove all '#<n>' if using column based input.

I took those seriously! If they're doing what they're supposed to, then the INFILE will put three records into the buffer at once, and AGE will be read from the first one, BALANCE from the second, and SALES from the third.

> And why column based input when DSD is used?

That one had me puzzled too.

> Data one; > infile 'e:\file10.txt' dsd truncover ; > input Age 1-10 balance 15-20 sales 25-30 @ ; > OUTPUT; > input Age 41-50 balance 55-60 sales 65-70 ; > OUTPUT; > run;

That's fine if all six fields are on the same record. The original INPUT statements, with their #<n>, imply that the two AGE fields are on the first of three records, the two BALANCE fields on the second, and the two SALES fields on the third.

It so happens that the fields being read from the three records are in non-overlapping positions, which means that if the original program had the #<n> there by mistake, your program does indeed do what Anna wanted, and Anna has been getting only one-third of the data she should have, and chopped up across records to boot. But her comment about having fifty variables or more makes me wonder about the original data structure.

Anna, could you tell us a little more about those INPUT records? Is the AGE/BALANCE/SALES information for two people/accounts/whatever contained all on one record, or distributed across three, one account on the left (cols 1-40), the other on the right?

[rest deleted; addresses the DSD issue]


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