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 

Sorting FB GDG file into FB sequential file

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


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue Mar 11, 2008 1:56 am    Post subject: Sorting FB GDG file into FB sequential file Reply with quote

Hi,

I have FB GDG file of LREC 132. I want to sort it and copy it into FB sequential file using DFSORT. The GDG file contains Header for first 10 records and from 11th record data will be there. Sortin should be done as (10,5,CH,A). There is tailer of one record at end of the file. Header and tailer should not be disturbed. Output file is sequential FB file.

I need to do the same process on FBA GDG file of LREC 133. Please help me with both the cases.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Mar 11, 2008 5:22 am    Post subject: Reply with quote

How do you determine header and trailer records - is it just by position or do they have special identifiers e.g. 0 and 9?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Tue Mar 11, 2008 7:41 am    Post subject: Reply with quote

"Sorting FB GDG file into FB sequential file"

An FB GDG is an FB sequential file!
Back to top
View user's profile Send private message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue Mar 11, 2008 7:44 am    Post subject: Reply with quote

I had already mentioned that first 10 records are header records and last record is tailer.
_________________
Thanks
Madhu Sudhan
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: Tue Mar 11, 2008 3:01 pm    Post subject: Reply with quote

So there's nothing unique about the trailer record that can be used to identify it as the trailer record? The only way you know it's the trailer record is that it's the last record? (I ask because the job you need is much easier to set up if we can identify the trailer record in some way other than it just being the last record).
_________________
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
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue Mar 11, 2008 11:26 pm    Post subject: Reply with quote

Yes Frank you are right. The only way I know the trailer record is that it is the last record.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12384
Topics: 75
Location: San Jose

PostPosted: Wed Mar 12, 2008 10:31 am    Post subject: Reply with quote

psmadhusudhan,

The following DFSORT JCL will give you the desired results.


Code:

//STEP0100 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE),RECFM=FB 
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  OUTFIL BUILD=(80X),                                       
  REMOVECC,NODETAIL,                                       
  TRAILER1=(C'TRLR,',COUNT=(M11,LENGTH=10))                 
/*                                                         
//STEP0200 EXEC PGM=ICEMAN     
//SYSOUT   DD SYSOUT=*         
//SYMNAMES DD DSN=&&T1,DISP=SHR
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=your output file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                     
                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(133:SEQNUM,8,PD)),
        IFTHEN=(WHEN=(133,8,PD,GT,10,AND,           
                      133,8,PD,LT,TRLR),             
       OVERLAY=(133:X'000000000000011C'))           
                                                     
  SORT FIELDS=(133,8,PD,A,                           
               010,5,CH,A)                           
                                                     
  OUTFIL BUILD=(01,132)                             
/*


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Aug 05, 2008 3:40 pm    Post subject: Reply with quote

You can now do this kind of thing quite easily with the new DATASORT operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). Here's an example:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER(10) TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(10,5,CH,A)
/*


For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
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
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