Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

need to get count of records based on header key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Fri Apr 30, 2010 11:39 am    Post subject: need to get count of records based on header key
Reply with quote

Hi,

I have a file with multiple headers with its corresponding records.I need to find the number of records under each header using key value in the header.Could any one help me on this??
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 30, 2010 11:53 am    Post subject:
Reply with quote

What sort do you have?
Post an example or sample of your actual input and expected output.
Input and output lrecl and recfm is also needed.

And, yes it can be done, but 'we' need more information.
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Fri Apr 30, 2010 12:01 pm    Post subject: Reply to: need to get count of records based on header key
Reply with quote

Input record look like this
Code:
HD1 Y00127SACG40IN00  201001251812 
01011245                000
01011245                000
01011245                000         
HD1 Y00127SSPK40IN00  201001251299 
56010072                000         
HD1 Y00127SSPK40IN00  201001251299 
01250812                000         

I need output as
Code:
SACG40201001251812 -3 records
SSPK40201001251299-1 record
SSPK40201001251299-1 record

Thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 30, 2010 12:20 pm    Post subject:
Reply with quote

Quote:
Code:
SACG40201001251812 -3 records
Is the extra space before the '-3 a typo?
Is the 'record(s) part of the output?
If so, do you expect record/records to grammatically correlate to the proper quantity?
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Fri Apr 30, 2010 12:25 pm    Post subject: Reply to: need to get count of records based on header key
Reply with quote

I need to have key field and its corresponding record number.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 30, 2010 12:39 pm    Post subject:
Reply with quote

jemonthomas wrote:
I need to have key field and its corresponding record number.
And that means what?

You are looking for trailer records with header information and detail counts, no problem.
But, answer the posted questions:
CICS Guy wrote:
Quote:
Code:
SACG40201001251812 -3 records
Is the extra space before the '-3 a typo?
Is the 'record(s) part of the output?
If so, do you expect record/records to grammatically correlate to the proper quantity?
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Fri Apr 30, 2010 12:53 pm    Post subject: Reply to: need to get count of records based on header key
Reply with quote

the space is typo error.
In the output file I need key value from header and Number of records under that hearder.Like that I need count for the number of records under each header
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Fri Apr 30, 2010 2:20 pm    Post subject:
Reply with quote

CICS Guy
wrote:
What sort do you have?


jemonthomas
You still didn't answer this question from CICS Guy...

I repeat What is the sort product you are using?

To find what sort product you are using then do following exercise..
expat wrote:

If the messages start with ICE then your product is DFSORT and the topic will be moved by a moderator to that forum. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
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: Fri Apr 30, 2010 11:41 pm    Post subject:
Reply with quote

jemon,

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HD1 Y00127SACG40IN00  201001251812
01011245                000
01011245                000
01011245                000
HD1 Y00127SSPK40IN00  201001251299
56010072                000
HD1 Y00127SSPK40IN00  201001251299
01250812                000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HD1'),
    PUSH=(1:11,6,23,12,81:ID=8))
  OUTFIL NODETAIL,REMOVECC,
     BUILD=(1,80),
     SECTIONS=(81,8,
       TRAILER3=(1,18,'-',COUNT-1=(EDIT=(T)),' records'))
/*
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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us