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
 

 

JCL to count records instead of copying it to another ds

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

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:11 pm    Post subject: JCL to count records instead of copying it to another ds
Reply with quote

Is there a JCL which we could use to count the number of records of a flatfile/dasd file or tape file?

Its just that I could not count if through max down then just look to the number of rows then thats it..

so I was hoping to have a JCL for this..

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

sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Jul 25, 2007 12:27 pm    Post subject:
Reply with quote

HI

You can use file aid with Tally option

Code:
//SYSIN    DD *
$$DD01 TALLY   
/*             




Quote:
instead of copying it to another ds


But this utily stlll can't cope with ur above requirement icon_rolleyes.gif
Back to top
View user's profile Send private message
0d311

Guest





PostPosted: Wed Jul 25, 2007 12:34 pm    Post subject:
Reply with quote

Hi Lui,

What do you mean by 'count'? Is there some sort of record ID which we can look up in the records?
Back to top
madlui56
Currently Banned

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:35 pm    Post subject:
Reply with quote

it resulted to max=8

having this as sysin:
$$DD01 TALLY
BTS01-UNABLE TO LOCATE TIOT ENTRY FOR DD01 .
.....SKIPPING TO NEXT $$DD CARD RC=8

any idea?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 25, 2007 12:40 pm    Post subject:
Reply with quote

Use ICEGENER with a DUMMY for SYSUT2.

Not the neatest of ways, but it works.
Back to top
View user's profile Send private message
madlui56
Currently Banned

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:50 pm    Post subject:
Reply with quote

count means just giving out the number of records through sysout instead of putting it to dataset or copying the dataset.

Iebgener..Is there a sample JCL for this?
Back to top
View user's profile Send private message
madlui56
Currently Banned

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:52 pm    Post subject: abended s322
Reply with quote

Is this the right code for Iebgener?

//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=WXX220.ECL2.ADHOC.FHFILE,DISP=SHR
//SYSUT2 DD DUMMY
//SYSIN DD *
/*

Thnks
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 25, 2007 12:57 pm    Post subject:
Reply with quote

madlui56
Check my post at this link
http://ibmmainframes.com/viewtopic.php?t=22616&postdays=0&postorder=asc&start=30
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: Wed Jul 25, 2007 10:38 pm    Post subject:
Reply with quote

See the "Display the number of input or output records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

You can use:

//SORTOUT DD SYSOUT=*

to get the count in SYSOUT.
Back to top
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Fri Jul 27, 2007 12:08 am    Post subject:
Reply with quote

you can use the count in the control cards and you can get it in the sysout=*
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Jul 28, 2007 3:39 pm    Post subject:
Reply with quote

madlui56 wrote:
it resulted to max=8

having this as sysin:
$$DD01 TALLY
BTS01-UNABLE TO LOCATE TIOT ENTRY FOR DD01 .
.....SKIPPING TO NEXT $$DD CARD RC=8

any idea?

Below JOB is working for me, give a try.
Code:
//FASTEP   EXEC PGM=FILEAID,REGION=6M         
//STEPLIB  DD  DISP=SHR,DSN=SYS1.NSMP.LINKLIB
//SYSPRINT   DD  SYSOUT=*                       
//SYSLIST  DD  SYSOUT=*                       
//DD01     DD  DSN=HLQ.FIRST.FILE,       
//             DISP=SHR                       
//*                                           
//SYSIN    DD *                               
$$DD01 TALLY                                 
/*                                           
//*                                           


SYSPRINT shows the following:(please see RECORDS-READ=5)
Code:
DD01     DSN=HLQ.FIRST.FILE OPENED AS PS,                                   
             RECFM=FB,LRECL=80,BLKSIZE=27920,VOL=MIZAB8                         
$$DD01 TALLY                                                            00100000
ABOVE FUNCTION ENDED ON NORMAL EOD                                       RC=0   
  RECORDS-READ=5                                                               
                                                                               


Hope this helps.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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