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

how to get count of a dataset


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Musab Razeen Ahmed

New User


Joined: 24 Feb 2011
Posts: 16
Location: India

PostPosted: Mon May 16, 2011 5:47 pm
Reply with quote

Hello All,

I have a situation as follows. There is a dataset which has a header and then a number of records as shown below

00000173822615/05/201100239MSAPOSCIS------>header
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764

A string of 5 zeroes indicates it is a header. Now i need to browse this file and take a count of all the records it contains(including header), and then i need to update columns 6 - 12 with this number. For example, if the above file contains 1999888 records, the header should look as

00000199988815/05/201100239MSAPOSCIS------>header
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764


Thanks,
Musab
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 16, 2011 6:05 pm
Reply with quote

Below steps will give you desired output...
Code:

//S1    EXEC  PGM=SORT                                         
//SORTIN DD *                                                   
00000XXXXXXX15/05/201100239MSAPOSCIS------>HEADER               
0100105299301047587655 T09 02266879                             
0100105299301047587655 T73 01057102                             
0100101005108244016212 T62 04275268                             
0100101005103040471844 T35 02201764                             
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)                         
//SYSOUT    DD  SYSOUT=*                                       
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,                                     
  TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=7),'''',80:X)   
/*                                                             
//S2    EXEC  PGM=SORT                                         
//SORTIN DD *                                                   
00000XXXXXXX15/05/201100239MSAPOSCIS------>HEADER               
0100105299301047587655 T09 02266879                             
0100105299301047587655 T73 01057102                             
0100101005108244016212 T62 04275268           
0100101005103040471844 T35 02201764           
//SORTOUT  DD SYSOUT=*                         
//SYMNAMES DD DSN=&&TEMP,DISP=(OLD,DELETE)     
//SYSOUT   DD  SYSOUT=*                       
//SYSIN    DD  *                               
  OPTION COPY                                 
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'00000'),     
  OVERLAY=(6:FCOUNT))                         
/*                                             

Output will be
Code:
00000000000515/05/201100239MSAPOSCIS------>HEADER   
0100105299301047587655 T09 02266879                 
0100105299301047587655 T73 01057102                 
0100101005108244016212 T62 04275268                 
0100101005103040471844 T35 02201764                 
Back to top
View user's profile Send private message
Musab Razeen Ahmed

New User


Joined: 24 Feb 2011
Posts: 16
Location: India

PostPosted: Mon May 16, 2011 6:22 pm
Reply with quote

Colud you please explain me the following line, B'coz i could not understand it? ( or you can specify a link wer i can i can get some info on it )

TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=7),'''',80:X)

Regards
Musab icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 16, 2011 6:59 pm
Reply with quote

Quote:
you can specify a link wer i can i can get some info on it

There is not rocket science... Go to google. .Search for DFSORT documentation .... You get it what needed...
Well... IBM is known for its good documentation... icon_smile.gif

OK.. This explains use of SYMNAMES .. Even I got this link via same way I told.. icon_smile.gif

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg40/4.1?SHELF=ICE1SH40&DT=20090519162426
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon May 16, 2011 9:57 pm
Reply with quote

Musab Razeen Ahmed,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
Musab Razeen Ahmed

New User


Joined: 24 Feb 2011
Posts: 16
Location: India

PostPosted: Tue May 17, 2011 12:42 pm
Reply with quote

Thanks All for your prompt replies.

The links and materials mentioned were quite useful.

Regards,
Musab icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top