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 

Ignore first Header record while sorting..

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


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Jan 23, 2003 4:56 am    Post subject: Ignore first Header record while sorting.. Reply with quote

Hi,

I have file structure as follows...

Header record
Detail 1
Detail2

The file is having sequential fixed block 80 and no duplicates

I want to sort on 10 to 15 position

Pls let me know can we do and if so .. post the jcl..

Thanks
Anand
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Thu Jan 23, 2003 5:55 am    Post subject: Reply with quote

Anand,

The following DFSORT/ICETOOL job would help you. If you have Syncsort, then change pgm to SYNCTOOL.
Code:

//STEP1    EXEC PGM=ICETOOL                   
//IN1      DD *                                 
HEADER
DFDFDFDFDF23345
DFDSDSFFDD23345
HJHGJJJGDE23345
FDGFDGDGDC23345
ABVCNNNFDA23345
ZSDFDFGGDB23345 
//TOOLMSG  DD SYSOUT=*                         
//DFSMSG   DD SYSOUT=*                         
//FILE1      DD SYSOUT=*                       
//TOOLIN   DD *                                 
 SORT FROM(IN1) TO(FILE1) USING(CTL1)           
/*                                             
//CTL1CNTL DD *                                 
  OMIT COND=(1,6,CH,EQ,C'HEADER')               
  SORT FIELDS=(10,6,CH,A) 
/*                         
//*                         

Coolman
________
uhwh


Last edited by coolman on Sat Feb 05, 2011 1:17 am; edited 1 time in total
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: Thu Jan 23, 2003 10:49 am    Post subject: Reply with quote

Another way to do this with DFSORT/ICETOOL is to use SKIPREC=1 to skip the first record instead of the OMIT statement, e.g.

Code:

//CTL1CNTL DD *                                 
  OPTION SKIPREC=1
  SORT FIELDS=(10,6,CH,A) 
/*                         


If you actually want the output file to have the HEADER record followed by the rest of the sorted records, the "Sort records between a header and trailer" Smart DFSORT Trick shows how to do that with DFSORT/ICETOOL:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
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


Last edited by Frank Yaeger on Thu Sep 14, 2006 4:38 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Mon Jan 27, 2003 6:15 am    Post subject: Reply with quote

Hi Coolman/Frank,

Thanks for ur response..

I want the header also to be present in the output file as first record..

What paramenters I should specify..

Thx
Anand
Back to top
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Mon Jan 27, 2003 7:03 am    Post subject: Reply with quote

Ravi,

Logically it's good.. Laughing but what if I want to insert that header in particualr postion..

Is it possible thru the utility

Thx
Anand
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Jan 27, 2003 8:14 am    Post subject: Reply with quote

Anand,
The following ICETOOL job can include your header as the first record.

Code:


//STEP1    EXEC PGM=ICETOOL                                     
//IN1      DD *                                                 
HEADER                                                           
DFDFDFDFDF23345                                                 
DFDSDSFFDD23345                                                 
HJHGJJJGDE23345                                                 
FDGFDGDGDC23345                                                 
ABVCNNNFDA23345                                                 
ZSDFDFGGDB23345                                                 
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//T3       DD SYSOUT=*                                           
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE)         
//T2       DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE)         
//CON      DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1             
//         DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2             
//TOOLIN   DD *                             
 COPY FROM(IN1) TO(T1) USING(CTL1)           
 SORT FROM(IN1) TO(T2) USING(CTL2)           
 COPY FROM(CON) USING(CTL3)                 
/*                                           
//CTL1CNTL DD *                             
  OPTION STOPAFT=1                           
/*                                           
//CTL2CNTL DD *                             
  OPTION SKIPREC=1                           
  SORT FIELDS=(10,6,CH,A)                   
/*                                           
//CTL3CNTL DD *                             
  OUTFIL FNAMES=T3                           
/*                                           
//                   
             


Coolman
________
marijuana pictures
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