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

How to sort Vsam files


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

New User


Joined: 20 Apr 2006
Posts: 2

PostPosted: Wed Jun 07, 2006 1:23 pm
Reply with quote

Hi all

is it possible to sort vsam files,if so how to sort Vsam files?
and also one more question is it possible to count the records in jcl by using sort utility
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed Jun 07, 2006 2:07 pm
Reply with quote

Hi,

Why would you like to sort a VSAM file? its already sorted with a key.

Yes. Its possible to count the number of records with SORT.
Please refer to DFSORT Manual at http://ibmmainframes.com/manuals.php for the syntax.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Jun 07, 2006 4:07 pm
Reply with quote

Well..In the first place why do you need to sort VSAM file ?? I dont think there is any need.

Secondly, for count of the number of records, search for 'COUNT' operator in this forum.

Thanks
ap_mainframes
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 Jun 07, 2006 9:06 pm
Reply with quote

Quote:
is it possible to sort vsam files,if so how to sort Vsam files?


Yes, you can use DFSORT to sort VSAM files. If you want more specific information, you need to explain more about what you're trying to do. Are you trying to use a VSAM file as input and a non-VSAM file as output, or a VSAM file as input and another VSAM file as output, or what? What is the position, length and format of the key you want to sort on? Are all of the records in the VSAM file the same length or are they different lengths?

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links

Quote:
and also one more question is it possible to count the records in jcl by using sort utility


Yes, you can get a count of the records with DFSORT in various ways. Here are two:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//TOOLIN DD *
COUNT FROM(IN)
/*


The count will be displayed in TOOLMSG.

Code:

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


The count will be displayed in SORTOUT.
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 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top