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 (July 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 11 Jul 2007 12:28:43 -0400
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: Reading in a hierarchical

only 1 tip for further trials: you should use always other variables for RETAINing something as the ones you use to read in:

not:

retain ZHV; ... input ZHV : $3. @;

but:

retain ZHV_dummy; ... input ZVH : $3. @; if zhv="ZHV" then do; ZVH_dummy=zvh; input ...ZVH-Line...; end; else do; input ...normal_line...; end;

Gerhard

On Wed, 11 Jul 2007 08:31:56 -0700, Metricsdude <bsj_adams@HOTMAIL.COM> wrote:

>Hi All, > >Can anyone give me any advice re the best way to read in a >hierarchical >file. I have the following data in a text file > > >ZHV|0000026338|B0014001|X|BAS|X|BAS|20070704101428|EGE|MDB||TEST| >001|G| >002|2445059444|1539345008| >102||||27||WHITE ROAD|||OLDHAM||OL11 9PW| >003|00000000012201231330|0000435126442||Mr A >test ||||||85084843359| >004|002717 |20070629|0000007080|0000007571|| > > >where ZHV line is the header and the 001 line signifies the start of >a >new group, I want to read in all the data from each 00 group onto one >line in a dataset. I also want to retain >the date from the header which i presume i just the retain >statement.... > >I am trying to use the input @ comand with if statements and but >can only read in the 001 and 002 data succesfully.... Any tips or >examples of code would be much appreicated. > >thanks >Ben


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