View previous topic :: View next topic
|
Author |
Message |
vasantha
New User
Joined: 05 Aug 2008 Posts: 16 Location: hyderabad
|
|
|
|
Hi,
I have two files. I need to compare date variables of these two files. When i declared two variables for two files and when compared the dates... the data in the first datastep is having value but when it comes to another datstep it is showing .(missing value).
Iam new to SAS, please help me...... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
The missing value in SAS (period) means that the numeric variable did not have a number read in the position(s) you specified. Please post the SAS code and the error messages in the SASLOG for more help. |
|
Back to top |
|
|
vasantha
New User
Joined: 05 Aug 2008 Posts: 16 Location: hyderabad
|
|
|
|
DATA PARM_CARD;
RETAIN CYC_DT_X 0;
INFILE PRMCARD;
INPUT @1 CYC_DT $8.;
CYC_DT_X = INPUT(CYC_DT,MMDDYY8.);
FORMAT CYC_DT_X MMDDYY10.;
DATA REIN_ACDC;
INFILE REINACDC EOF=TOTALS;
INPUT @42 RIN_SYSDT PD4.;
PUT 'CYC_DT_X :- ' CYC_DT_X;
SYS_DT = DATEJUL(RIN_SYSDT);
FORMAT SYS_DT MMDDYY10.;
RUNNUM = 'JRN200';
COUNT + 1;
IF SYS_DT = CYC_DT_X THEN DO;
COUNTR + 1;
END;
GO TO BOTTOM;
TOTALS:
FILE SASREPT;
in the SAS log..it is displaying the values as:
CYC_DT_X :- .
CYC_DT_X :- .
CYC_DT_X :- . |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
It will always say that ... you've got a DATA step followed by a DATA step. Unless you link the two, the data read in the second step has no relationship to the data read in the first step. From your code, what I think you need to do is:
Code: |
DATA REIN_ACDC;
IF _N_ = 1 THEN SET PARM_CARD;
RETAIN CYC_DT_X;
INFILE REINACDC EOF=TOTALS; |
instead of
Code: |
DATA REIN_ACDC;
INFILE REINACDC EOF=TOTALS; |
|
|
Back to top |
|
|
vasantha
New User
Joined: 05 Aug 2008 Posts: 16 Location: hyderabad
|
|
|
|
Thank you so much now iam able to get the correct O/P....
Thanks a lot..............At last i have successfully finished one SAS program |
|
Back to top |
|
|
|