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

Count a records within JCL with condition?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arafath85

New User


Joined: 10 Nov 2008
Posts: 1
Location: Hyderabad

PostPosted: Sun Jan 25, 2009 7:23 pm
Reply with quote

How to count a number of records in JCL with specified conditions and the result should be display in form of report kind?
Ex; There were 3 differtent types of records like A,B,C in XXX.YYY dataset and i want to count number of A,B,C type records with JCL itself?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sun Jan 25, 2009 7:37 pm
Reply with quote

A program ( or utility which is also a program ) will do that NOT A JCL.

What kind of program do you want to use?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Jan 25, 2009 8:08 pm
Reply with quote

arafath85,

Welcome to the forums. You can do this using any of the SORT utilities available in your shop. But you need to mention more specific details about the rules for extracting records and the below info.

Input RECFM/LRECL
Output RECFM/LRECL
Starting position,length and format of relevant fields.
A few sample input records showing relevant fields and the expected output out of it.

PS. While posting code, please use the "Code" tag provided here. "Preview" it to verify your post displays correctly before doing "Submit".
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: Sun Jan 25, 2009 8:24 pm
Reply with quote

Quote:
and i want to count number of A,B,C type records with JCL itself?
You'll be waiting a long time to do this -- JCL does one thing and only one thing -- execute programs (which include utilities). JCL does nothing else, especially not counting stuff. A program JCL executes may count stuff but the JCL doesn't.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 26, 2009 9:51 pm
Reply with quote

Yasar,

You can do what you want with DFSORT. Exactly how you would do it depends on exactly what your input records look like and exactly what you want for the output report. But if you just need something simple, you can use a DFSORT/ICETOOL job like this:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
A
A
A
B
C
C
C
C
/*
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) ON(1,1,CH) ON(VALCNT) BLANK
/*


RPT would have:

Code:

(1,1,CH)       VALUE COUNT   
A                        3   
B                        1   
C                        4   


For more information on the OCCUR operator of DFSORT's ICETOOL, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.9?DT=20060615185603
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top