IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SAS help required


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreenivasreddyg

New User


Joined: 23 Apr 2005
Posts: 39
Location: delhi

PostPosted: Thu Jan 08, 2009 7:26 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 08, 2009 8:02 am
Reply with quote

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
View user's profile Send private message
sreenivasreddyg

New User


Joined: 23 Apr 2005
Posts: 39
Location: delhi

PostPosted: Thu Jan 08, 2009 8:55 am
Reply with quote

Thank you. I will try this and let you know.
Back to top
View user's profile Send private message
sreenivasreddyg

New User


Joined: 23 Apr 2005
Posts: 39
Location: delhi

PostPosted: Fri Jan 09, 2009 2:41 am
Reply with quote

I tried this and worked fine. Thanks for yoru help!!!!!!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 09, 2009 5:08 am
Reply with quote

Glad to hear it worked.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Required Date Format in Include Sort ... DFSORT/ICETOOL 6
No new posts COMPUSET/XICS z/os document required All Other Mainframe Topics 1
No new posts Number of Packages required for stati... DB2 4
No new posts Receommendations required for adding ... JCL & VSAM 5
No new posts FTP help required All Other Mainframe Topics 3
Search our Forums:

Back to Top