MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can VB data set be sorted?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Mon Jan 16, 2006 10:14 am    Post subject: Can VB data set be sorted? Reply with quote

Hi,

I use following JCL to sort data set. It is ok with FB data set. but can not get output for VB data set like
Code:

 %   XT Device  Dsorg Recfm Lrecl Blksz
---------------------------------------
  TTOS.HH.OPT.TTSSEEG.D060111       
 98   1 3390     PS   VB      726  8192

parts file:
Code:

6162003002348AP H2003-01-01EVincent                               
6162003008014AP H2003-11-18NSMITHE   clownfish                     
6162003009506AP H2003-11-07EVAN PELT                               
6162003009761AP H2003-11-07N                                       
8972004+11401AG H2004-01-01EFAULT                                 
6722004012699AP H2003-01-01NFAULT                                 

The job log return is 0.
Can VB data set be sorted ?

Code:

// SET SOURCE=TTOS.HH.OPT.TTSSEEG.D060111                 
// SET DESTIN=ANDY.TEST.TRY                         
//SORT001  EXEC PGM=SORT,REGION=0M
//SYSOUT   DD SYSOUT=*                                 
//SYSUDUMP DD SYSOUT=*                                 
//SORTIN   DD DSN=&SOURCE,DISP=SHR                     
//SORTOUT  DD DSN=&DESTIN, DISP=(,CATLG), UNIT=SYSDA,   
//            LIKE=&SOURCE                             
//SORTWK01 DD SPACE=(CYL,(20,10)),UNIT=SYSDA           
//SORTWK02 DD SPACE=(CYL,(20,10)),UNIT=SYSDA           
//SYSIN    DD *                                         
 SORT FIELDS=(1,15,CH,A)                               
 INCLUDE COND=(17,5,EQ,C'H2004'),FORMAT=CH             
/*       

_________________
cheers,
Andy
Back to top
View user's profile Send private message
prakal
Beginner


Joined: 14 Mar 2003
Posts: 22
Topics: 1

PostPosted: Mon Jan 16, 2006 10:28 am    Post subject: Reply with quote

Yes VB data can be sorted.

VB data has a 4 byte RDW at the begining of each record. You will have to consider this 4 byte RDW while creating your sort card.

Assuming the above SORT fields and INCLUDE cond are used for a FB file, change it as shown below to use it for a VB file:

Code:
 
 SORT FIELDS=(5,15,CH,A)
 INCLUDE COND=(21,5,EQ,C'H2004'),FORMAT=CH


Do note that in the SORT fields and INCLUDE cond the starting byte position has been changed from 1 to 5 and from 17 to 21 to accommodate the 4 byte RDW.
Back to top
View user's profile Send private message
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Mon Jan 16, 2006 10:30 am    Post subject: Reply with quote

Hello Andy,

VB Files can both be sorted into... and sorted from, please do a search and you will find countless samples. Just be sure to manage appropiatedly the RDW, which is located in the first four bytes of each record. Also if you use the LIKE parm in your DD def, you are 'copying' an existing DCB, therefore if your 'Model' is not VB your resulting one won't be either.
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jan 16, 2006 11:07 am    Post subject: Reply with quote

Andy,

For FB input, the first data byte is in position 1. For VB input, the first data byte is in position 5 - you have to add 4 bytes for the RDW in positions 1-4.

prakal wrote:

Quote:
Do note that in the SORT fields and INCLUDE cond the starting byte position has been changed from 1 to 5 and from 17 to 22 to accommodate the 4 byte RDW.


1+4 = 5 for SORT statement.
17+4 = 21 for INCLUDE statement (not 22).

I edited your post to correct the error.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Thu Jan 19, 2006 12:44 am    Post subject: Reply with quote

Thank you guys. It is the point.
_________________
cheers,
Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group