View previous topic :: View next topic
|
Author |
Message |
sreenivasreddyg
New User
Joined: 23 Apr 2005 Posts: 39 Location: delhi
|
|
|
|
I have a file with 1000 records and I need to read the last record which contains the date. By using that date I need to read all the records having the date less than the date in the last record and also need to create report. I am not sure how we can read the last record and store the date. Again, need to read the file fom the beginning. Please help. If you need any more information please let me know. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
DATA A;
INFILE DDNAME END=EOF;
INPUT @ ;
IF EOF THEN DO; INPUT @??? DATEFIELD ; OUTPUT; END;
DATA B;
INFILE DDNAME ;
IF _N_ = 1 THEN SET A; RETAIN DATEFIELD;
INPUT @?? BDATE ...
IF BDATE < DATEFIELD ;
|
Untested but this should work. |
|
Back to top |
|
|
sreenivasreddyg
New User
Joined: 23 Apr 2005 Posts: 39 Location: delhi
|
|
|
|
Thank you. I will try this and let you know. |
|
Back to top |
|
|
sreenivasreddyg
New User
Joined: 23 Apr 2005 Posts: 39 Location: delhi
|
|
|
|
I tried this and worked fine. Thanks for yoru help!!!!!! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear it worked. |
|
Back to top |
|
|
|