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

JCL to count records instead of copying it to another ds


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

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:11 pm
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
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
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

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:35 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Jul 25, 2007 12:40 pm
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

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:50 pm
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

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Wed Jul 25, 2007 12:52 pm
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
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 Developer


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

PostPosted: Wed Jul 25, 2007 10:38 pm
Reply with quote

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

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
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

Superior Member


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

PostPosted: Sat Jul 28, 2007 3:39 pm
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 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