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

Need a sample batch SAS pgm, flat file in, accum totals out


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dkaster

New User


Joined: 21 Mar 2011
Posts: 2
Location: USA

PostPosted: Fri Mar 25, 2011 9:44 pm
Reply with quote

I need to verify record counts and accum totals on fields is a series of mainframe flat files, and all I have available is SAS. I'm able to print and accum an entire file, but only want and need to see the bottom line (not the millions of individual records). I've been through "dummies", but it (and the SAS site) only covers the online app and statistics. Can anyone 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 Mar 25, 2011 10:40 pm
Reply with quote

Code:
DATA _NULL_;
     INFILE DDIN END=EOF;
     INPUT ;
     NRECS + 1;
     IF  EOF
     THEN DO;
          FILE PRINT;
          PUT 'RECORD COUNT = ' NRECS COMMA10.;
          END;
Use _NULL_ to not create a SAS data set. DDIN is the DD name for the input file. If you just want a count, don't input any variables but if you need field counts, change the INPUT statement appropriately. The END= sets a variable to TRUE when the end of the input file is reached.
Back to top
View user's profile Send private message
dkaster

New User


Joined: 21 Mar 2011
Posts: 2
Location: USA

PostPosted: Sat Mar 26, 2011 2:55 am
Reply with quote

Great, just what I needed - thanks!
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top