Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to get count of a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Musab Razeen Ahmed

New User


Joined: 24 Feb 2011
Posts: 15
Location: India

PostPosted: Mon May 16, 2011 5:47 pm    Post subject: how to get count of a dataset
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    Post subject:
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: 15
Location: India

PostPosted: Mon May 16, 2011 6:22 pm    Post subject:
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    Post subject:
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

http://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    Post subject:
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:

http://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: 15
Location: India

PostPosted: Tue May 17, 2011 12:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us