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

sorting a VSAM file into a VB length flat file


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

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Sat Dec 16, 2006 10:38 am
Reply with quote

Hi
Can ne1 explain, in sorting a VSAM file into a VB length flat file,
position we give in SORT FIELDS is actual or it's POSition+4 ?
why?
e.g.
I want to sort VSAM file using it's first 8 bytes, into a new VBL flat file,
wat shud the values in SORT FILEDS ?

SORT FIELDS=(1,8,CH,A)
or
SORT FIELDS=(5,8,CH,A)

Pls justify..
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Sat Dec 16, 2006 11:14 am
Reply with quote

Check out... VSAM Processing with DFSORT...
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: Sat Dec 16, 2006 9:50 pm
Reply with quote

prafull,

Priyesh gave the correct DFSORT reference.

To answer your question more directly, for the situation you describe, you would use:

Code:

   RECORD TYPE=V
   SORT FIELDS=(5,8,CH,A)
Back to top
View user's profile Send private message
prafull

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Thu Dec 21, 2006 2:18 pm
Reply with quote

I dont see any use of RECORD TYPE=..
the result is same .. u provided RECORD TYPE or not.. wat matters is the position ..+4
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: Thu Dec 21, 2006 9:11 pm
Reply with quote

Quote:
the result is same .. u provided RECORD TYPE or not


Not necessarily. It may be true in your case because of the way your job is coded (for example, if you specified RECFM=VB for SORTOUT), but you didn't show your complete job, so I gave you control statements that would assure your job worked correctly.

If you don't specify RECORD TYPE=V for a VSAM input file, then DFSORT uses a default record type of F or V depending on several factors as described here under TYPE:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.15?DT=20060615185603

So without RECORD TYPE=V, you may get the correct record type of V by default or you may not as indicated. With RECORD TYPE=V, you will always get the correct record type of V. And yes, with a record type of V, DFSORT prepends an RDW in positions 1-4, so the first data byte starts in position 5 which translates to adding +4 to the data position.
Back to top
View user's profile Send private message
prafull

New User


Joined: 08 Dec 2006
Posts: 48

PostPosted: Fri Dec 22, 2006 11:22 am
Reply with quote

Yes, u r right..
This part skipped from my mind..
Thanks for the info Frank Yaeger!
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
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