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 (April 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 29 Apr 2003 10:52:27 -0700
Reply-To:     Prasad S Ravi <prasad.s.ravi@HOUSEHOLD.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Prasad S Ravi <prasad.s.ravi@HOUSEHOLD.COM>
Subject:      Re: please help
Comments: To: "Chen, Jian" <ozz6@CDC.GOV>
Content-type: text/plain; charset=us-ascii

Jian:

The way JCL is written is these files get appended, you may want to read them as two separate files into two separate datasets, do your assignment statements and then append the SAS datasets. That's one way to do it.

Like JCL: //PER1 DD DSN=CC37. NHIS70.PERSONSX, DISP=SHR, UNIT=TAPE80 //PER2 DD DSN=CC37.NHIS80.PERSONSX, DISP=SHR, UNIT=TAPE80

data persons1; infile per1; input year 20 location 21 sex 23; if year=0 then year=70; run;

data persons2; infile per2; input year 20 location 21 sex 23; if year=0 then year=80; RUN;

PROC APPEND BASE=PERSONS1 DATA=PERSONS2; RUN;

Prasad Ravi

"Chen, Jian" <ozz6@CDC.GOV> To: SAS-L@LISTSERV.UGA.EDU Sent by: "SAS(r) cc: Discussion" Subject: please help <SAS-L@LISTSERV.UGA.E DU>

04/29/2003 10:11 AM Please respond to "Chen, Jian"

Hi, All SAS users:

I have a question. Following is mainframe JCL and some SAS codes.

JCL: //PER DD DSN=CC37. NHIS70.PERSONSX, DISP=SHR, UNIT=TAPE80 // DD DSN=CC37.NHIS80.PERSONSX, DISP=SHR, UNIT=AFF=PERSON ...

data persons; infile per; input year 20 location 21 sex 23; ???if year=0 then year=70(if year=0 comes from NHIS70.PERSONSX) or year=80 (if year=0 comes from NHIS70.PERSONSX) .... ....

There is one variable named YEAR which exists in both of the two files. YEAR=0 in these two files, that is, NHIS70.PERSONSX and NHIS80.PERSONSX. How can I do the following: when year=0 comes from NHIS70.PERSONSX, I want to assign year=70, when year=0 comes from NHIS80.PERSONSX, I want to assign year=80.

Thanks a lot!


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