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 

DFSORT: split file to multiple GDG files by n records

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


Joined: 15 May 2007
Posts: 9
Topics: 2

PostPosted: Wed Aug 20, 2008 2:34 pm    Post subject: DFSORT: split file to multiple GDG files by n records Reply with quote

Is that possible to split input file by n records into multiple GDG files when number of output files in unknown?

For instance, there is an input file with 1000 records which to be split by 10 contiguous records into GDG data sets.

Can I pass a GDG base name to DFSORT, so that it creates a necessary number of GDG datasets?

The SPLIT1R samples I found use predefined DSNs for output files.

Thanks in advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 20, 2008 3:53 pm    Post subject: Reply with quote

rover,

Does the order of records matter? If you just supply the GDG Base to sortin the system concatenates the latest version first and oldest version will be the last one. Is that order ok ? Do you need the oldest generation data first?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rover
Beginner


Joined: 15 May 2007
Posts: 9
Topics: 2

PostPosted: Thu Aug 21, 2008 1:53 am    Post subject: Reply with quote

kolusu,

sorry, I'm confused.

You say 'supply the GDG Base to sortin', but I need GDG base to be 'sortout'. It's required to split input sequential dataset into multiple output GDG datasets and have DFSORT allocate and fill as many generations as required for operation.

For sample above, I need DFSORT to allocate 100 GDG data sets for given GDG base, so that I don't have to define them in JCL as: GDG(+1), GDG(+2), GDG(+3), GDG(+n).

The order of records does not matter, i.e. records from input data set can be placed into output generations in any order. Only a number of output records matters.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Aug 21, 2008 1:27 pm    Post subject: Reply with quote

Rover,

Sorry. I misunderstood you requirements before.

Here is a DFSORT job which will give you the desired results. The number of files you want to split is controlled via symnames. For ex: if you want to split the input file into 10 you simply provide

Code:

FNUM,+10


The job will take this number and generate DD definitions for 10 files and also SPLIT1R parm to split the records

You can change this number to any number(<=256) you want. You can only have a max 256 generations for a gdg, you cannot go beyond that number.

Verify the output from step0200. It will have the actual Job required to split the input file. Once verified that JCL is created correctly change the following statement in step0200

Code:

//SORTOUT  DD SYSOUT=*


to the following
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


This will submit the generated job via INTRDR

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD *                                           
FNUM,+10                                                   
//SORTIN   DD DSN=YOUR.GDG BASE TO BE SPLIT,
//            DISP=SHR                                     
//C1       DD DSN=&&C1,DISP=(,PASS),SPACE=(TRK,(1,1))     
//C2       DD DSN=&&C2,DISP=(,PASS),SPACE=(TRK,(1,1))     
//C3       DD DSN=&&C3,DISP=(,PASS),SPACE=(TRK,(1,1))     
//D1       DD DSN=&&D1,DISP=(,PASS),SPACE=(TRK,(1,1))     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC BUILD=(SEQNUM,8,PD,80:X)                           
  OUTREC OVERLAY=(9:1,8,PD,DIV,FNUM,M11,LENGTH=10)
         
  OUTFIL FNAMES=C1,REMOVECC,NODETAIL,                     
  HEADER1=(' OPTION COPY',/,' OUTFIL FNAMES=(OUT001,')     

  OUTFIL FNAMES=C2,INCLUDE=(1,8,PD,LT,FNUM),               
  IFTHEN=(WHEN=INIT,                                       
  BUILD=(16X,C'OUT',SEQNUM,3,ZD,START=2,INCR=1,C',',80:X)),
  IFTHEN=(WHEN=(20,3,ZD,EQ,FNUM),                         
  OVERLAY=(23:C'),'))                                     

  OUTFIL FNAMES=C3,REMOVECC,NODETAIL,                     
  TRAILER1=(16X,'SPLIT1R=',9,10,/,'//*')                   
                                                           
  OUTFIL FNAMES=D1,INCLUDE=(1,8,PD,LE,FNUM),               
  BUILD=(C'//OUT',SEQNUM,3,ZD,4X,C'DD DSN=',               
         C'YOUR OUT GDG BASE(+',SEQNUM,3,ZD,C'),'/,       
         C'//',13X,C'DISP=(NEW,CATLG,DELETE),',/,         
         C'//',13X,C'UNIT=SYSDA,',/,                       
         C'//',13X,C'SPACE=(CYL,(X,Y),RLSE)',/,           
         C'/*',80:X)                                       
/*
//STEP0200 EXEC  PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                   
//SYSIN    DD *                         
  OPTION COPY                           
//SORTOUT  DD SYSOUT=*                   
//SORTIN   DD DATA,DLM=$$               
//YOURTIDZ JOB 'COPY',                   
//             CLASS=A,                 
//             MSGCLASS=Y,               
//             MSGLEVEL=(1,1),           
//             NOTIFY=&SYSUID           
//*                                     
//STEP0100 EXEC  PGM=ICEMAN               
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD DSN=YOUR GDG TO BE SPLIT, 
//            DISP=SHR                   
//SYSIN    DD *                         
$$                                       
//         DD DSN=&&C1,DISP=(OLD,PASS)   
//         DD DSN=&&C2,DISP=(OLD,PASS)   
//         DD DSN=&&C3,DISP=(OLD,PASS)   
//         DD DSN=&&D1,DISP=(OLD,PASS)   
/*


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
ganesh_b
Beginner


Joined: 06 Apr 2005
Posts: 12
Topics: 2

PostPosted: Thu May 28, 2009 2:34 pm    Post subject: GDG base - How to get Oldest generation data first in output Reply with quote

Kolusu,

Quote:
Does the order of records matter? If you just supply the GDG Base to sortin the system concatenates the latest version first and oldest version will be the last one. Is that order ok ? Do you need the oldest generation data first?


Is there a way in sort to get the oldest generation data first? I would like to use the GDG base and create the output with data from the oldest generation to latest generation.

I searched in the forum and could not find anything relevant. As this topic had the question mentioned, updated the same.

Thanks!
Ganesh.
_________________
Ganesh.B
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 28, 2009 4:03 pm    Post subject: Reply with quote

ganesh_b,

Check the smart DFSORT trick Copy GDG records in first in, first out order here

http://www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ganesh_b
Beginner


Joined: 06 Apr 2005
Posts: 12
Topics: 2

PostPosted: Fri May 29, 2009 10:41 am    Post subject: Reply with quote

Kolusu,

Thanks for the link. I could have searched there before posting the question.
_________________
Ganesh.B
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