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
 
Count a records within JCL with condition?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Count a records within JCL with condition?
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: 456
Location: Belgium

PostPosted: Sun Jan 25, 2009 7:37 pm    Post subject:
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: 2287
Location: @my desk

PostPosted: Sun Jan 25, 2009 8:08 pm    Post subject:
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: 8200
Location: East Dubuque, Illinois, USA

PostPosted: Sun Jan 25, 2009 8:24 pm    Post subject:
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 Moderator


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

PostPosted: Mon Jan 26, 2009 9:51 pm    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am

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