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 (October 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 13 Oct 2004 15:22:38 -0400
Reply-To:   Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:   Re: Parsing the HLQ of a dataset

In some situations you can just declare the period as a delimiter and read your HLQ (High Level Qaulifier?) directly:

DATA _NULL_; INFILE DATALINES DLM=' .'; INPUT HLQ $; PUT HLQ=; DATALINES; SGSS.KEITH.DS1 #SG.RALPH.DS2 DB2ADMN.DBP1.DATA RUN;

On Wed, 13 Oct 2004 09:03:39 -0400, Mike Rhoads <RHOADSM1@WESTAT.COM> wrote:

>Keith, > >The SCAN function is what you want. > >DATA _NULL_; >LENGTH DSN $ 44 HLQ $ 8; >INPUT DSN; >HLQ = SCAN(DSN,1,'.'); >PUT HLQ=; >DATALINES; >SGSS.KEITH.DS1 >#SG.RALPH.DS2 >DB2ADMN.DBP1.DATA >RUN; > >Mike Rhoads >Westat >RhoadsM1@Westat.com > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >McWhorter, Keith >Sent: Wednesday, October 13, 2004 8:46 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Parsing the HLQ of a dataset > > >Good morning, > > > >I'm under the gun to generate a report. I know this must be a simple >command, but it's not in my SAS vocabulary yet! ;-) > > > >I'm reading in a 44-character data set name, and want to find the HLQ, >which can vary in length, but of course is terminated by a period. >Example: > > SGSS.KEITH.DS1 > > #SG.RALPH.DS2 > > DB2ADMN.DBP1.DATA > > > >So the HLQ's are SGSS, #SG and DB2ADMN. So how is it that I read the >variable until the first period? > > > >Many thanks!!! > > > >(BTW, running SAS 9.1.2 under z/OS 1.4.) > > > >Keith McWhorter > >Senior Systems Programmer > >Georgia Technology Authority > >404-656-9068


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