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

How can U find out number of records in VSAM file ...


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rtalapaneni

New User


Joined: 20 Mar 2005
Posts: 13
Location: Bangalore

PostPosted: Mon Oct 17, 2005 5:16 pm
Reply with quote

How can U find out number of records in VSAM file ...
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Oct 17, 2005 5:35 pm
Reply with quote

Try this simple code.....

Code:
//S010    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=USERID.RECORDS.INPUT.VSAM,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN)
/*


Regards,

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

New User


Joined: 31 Aug 2005
Posts: 48
Location: U.K.

PostPosted: Mon Oct 17, 2005 9:09 pm
Reply with quote

I believe this was discussed previously.

If you have File-Aid, then you may find out the number of records without submitting a job. You can do this by using option 3.5 for the VSAM dataset, without providing any options at the command line (to display dataset info). The number of records on the VSAM file are displayed as Prime Records on the second page. (Hit ENTER to access additional pages of dataset info).

Hope this helps,
Panda.
Back to top
View user's profile Send private message
Ravi gaur

New User


Joined: 12 Jul 2005
Posts: 38

PostPosted: Tue Oct 18, 2005 3:19 pm
Reply with quote

Plz check again for a VSAM dataset.
//S010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=USERID.RECORDS.INPUT.VSAM
//TOOLIN DD *
COUNT FROM(IN)
/*

is above code is correct or not..

as when i m running giving error
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Oct 18, 2005 3:30 pm
Reply with quote

Thanks for pointing Ravi....
Missing DISP parameter caused that Error....

I 've got the code above corrected too.....

Regards,

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

New User


Joined: 20 Mar 2005
Posts: 13
Location: Bangalore

PostPosted: Tue Oct 18, 2005 10:15 pm
Reply with quote

Thanks for all ..
Can I use this code by using SORT pgm ...
Let me know the difference between SORT,DFSORT,SYNCSORT,ICETOOL ....
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 Oct 19, 2005 12:40 am
Reply with quote

Quote:
Can I use this code by using SORT pgm ...


COUNT is a DFSORT/ICETOOL operator. You can also create one record with the count using DFSORT directly with a DFSORT job like this:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,TRAILER1=(COUNT=(M11,LENGTH=8))
/*


Quote:
Let me know the difference between SORT,DFSORT,SYNCSORT,ICETOOL ....


SORT is the generic name for various sort products, two of which are DFSORT and Syncsort (the other is CA-SORT). DFSORT is an IBM product and an optional feature of z/OS. Syncsort is Syncsort, Inc's sort product. ICETOOL is a free "utility" shipped with DFSORT (since 1991).

For much more information on DFSORT, visit the DFSORT website at:

www.ibm.com/storage/dfsort/

and access the DFSORT books online from:

Use [URL] BBCode for External Links

If you or anyone else on this board would like some documents prepared by the DFSORT Team that describe what we see as the advantages of DFSORT over Syncsort, as well as considersations for migrating from Syncsort to DFSORT, send me an e-mail offline (yaeger@us.ibm.com). Please put "DFSORT" somewere in your Subject line to catch my attention.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Wed Oct 19, 2005 12:43 am
Reply with quote

Quote:
Let me know the difference between SORT,DFSORT,SYNCSORT,ICETOOL


Please search the forum with the author name as Frank ,,u can find lot of details.

Thank you
Back to top
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Fri Oct 21, 2005 6:05 pm
Reply with quote

FRANK,

To add to this ...can we write the counts for a set of files given as input to a output file one by one along wiht the file name.

How to capture the file name for which we are getting the count and writing to a output file

ex.

input file

filename1
filename2
.
.
filename10


output file

filename1 10
filename2 20


currently we are doing it in rexx..is there any other simple way.


thanks,

Deepa
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: Sun Oct 23, 2005 9:15 pm
Reply with quote

You could do this by having DFSORT use the file names to generate a DFSORT job to submit to the internal reader. Let me know if you want me to show you how to do that.
Back to top
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Oct 25, 2005 1:29 pm
Reply with quote

yes please Frank..let me know how it can be done.
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: Tue Oct 25, 2005 9:23 pm
Reply with quote

Deepa,

Here's a DFSORT job that generates and submits an ICETOOL job to the internal reader to do what you asked for.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file with filenames in 1-44
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC FIELDS=(1,44,45:SEQNUM,3,ZD)
  OUTFIL FNAMES=T1,
    OUTREC=(C' COPY FROM(IN',45,3,C') TO(OUT',45,3,C')',
      C' USING(C',45,3,C')',80:X)
  OUTFIL FNAMES=T2,
     OUTREC=(C'//IN',45,3,C' DD DISP=SHR,DSN=',1,44,80:X,/,
      C'//OUT',45,3,C' DD SYSOUT=*',/,
      C'//C',45,3,C'CNTL DD *',/,
      C' OUTFIL FNAMES=OUT',45,3,C',REMOVECC,NODETAIL,',/,
      C'  TRAILER1=(C''',1,44,C''',',/,
      C'  2X,COUNT=(M11,LENGTH=5))')
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DATA,DLM=QQ
//CTS      JOB ...            <--- jobcard
//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
QQ
//  DD DSN=&&T1,DISP=(OLD,PASS)
//  DD DSN=&&T2,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=(A,INTRDR)
//SYSIN    DD    *
  OPTION COPY
/*


The submitted job looks like this:

Code:

//CTS      JOB ...            <--- jobcard
//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN001) TO(OUT001) USING(C001)
 COPY FROM(IN002) TO(OUT002) USING(C002)
 ...
//IN001 DD DISP=SHR,DSN=dsname1
//OUT001 DD SYSOUT=*
//C001CNTL DD *
 OUTFIL FNAMES=OUT001,REMOVECC,NODETAIL,
  TRAILER1=(C'dsname1                                     ',
  2X,COUNT=(M11,LENGTH=5))
//IN002 DD DISP=SHR,DSN=dsname2
//OUT002 DD SYSOUT=*
//C002CNTL DD *
 OUTFIL FNAMES=OUT002,REMOVECC,NODETAIL,
  TRAILER1=(C'dsname2                                     ',
  2X,COUNT=(M11,LENGTH=5))
...


Each OUTnnn output file displays the 44 character input data set name and a 5 digit count of its records.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top