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 

Split File based on Record Type Grouping

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
iamgsundar
Beginner


Joined: 22 May 2015
Posts: 2
Topics: 1

PostPosted: Tue May 26, 2015 2:26 pm    Post subject: Split File based on Record Type Grouping Reply with quote

Hi All,
I need a help to split a VB file based on record type grouping. We have a file which contains thousands of application data records. Each application will have many record types.
Record type 01 to another record type 01 will be considered as one application data. We need split file based on Number of applications, like 500 application data records in each output file. Say if the input file has 30K applications we need write 60 output files. The number of applications per day will vary.
Please find the sample input and output files below.

Thanks in Advance.


Input Record Format:
Code:

00<Header_Record>
01<Application_MetaData_1>
02<RT_1_Records_1>
02<RT_2_Records_1>
02<RT_3_Records_1>
02<RT_4_Records_1>
01<Application_MetaData_2>
02<RT_1_Records_2>
02<RT_2_Records_2>
02<RT_3_Records_2>
02<RT_4_Records_2>
01<Application_MetaData_3>
02<RT_1_Records_3>
02<RT_2_Records_3>
02<RT_3_Records_3>
02<RT_4_Records_3>
01<Application_MetaData_4>
02<RT_1_Records_4>
02<RT_2_Records_4>
02<RT_3_Records_4>
02<RT_4_Records_4>
99<Trailer_Records>


Expected Output in 4 files as per the number of Application Data
File_1:
Code:

00<Header_Record>
01<Application_MetaData_1>
02<RT_1_Records_1>
02<RT_2_Records_1>
02<RT_3_Records_1>
02<RT_4_Records_1>
99<Trailer_Records>

File_2:
Code:

01<Application_MetaData_2>
02<RT_1_Records_2>
02<RT_2_Records_2>
02<RT_3_Records_2>
02<RT_4_Records_2>
99<Trailer_Records>

File_3:
Code:

01<Application_MetaData_3>
02<RT_1_Records_3>
02<RT_2_Records_3>
02<RT_3_Records_3>
02<RT_4_Records_3>
99<Trailer_Records>

File_4:
Code:

01<Application_MetaData_4>
02<RT_1_Records_4>
02<RT_2_Records_4>
02<RT_3_Records_4>
02<RT_4_Records_4>
99<Trailer_Records>
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 26, 2015 3:20 pm    Post subject: Re: Split File based on Record Type Grouping Reply with quote

iamgsundar wrote:

Record type 01 to another record type 01 will be considered as one application data. We need split file based on Number of applications, like 500 application data records in each output file. Say if the input file has 30K applications we need write 60 output files. The number of applications per day will vary.
Please find the sample input and output files below.


It is quite simple using WHEN=GROUP and split the file, however you might end up with empty files if you used the fixed number of OUTFIL files. If you want dynamic allocation then you need 2 passes of data.

What version of DFSORT are you running? Run the following JCL and show us the complete sysout which will help us determine the level of DFSORT you have.

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *         
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *         
  OPTION COPY           
//* 

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iamgsundar
Beginner


Joined: 22 May 2015
Posts: 2
Topics: 1

PostPosted: Tue May 26, 2015 3:52 pm    Post subject: Reply with quote

Thanks for the reply.

Please find the sysout log.
Code:


1 SYNCSORT FOR Z/OS  1.3.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSORT INC.   DATE=2015/146   TIME=16.42.16
                                      AMERICAN EXPRESS   TRS   IPC   z/OS   1.13.0                                       
  SYNCSORT LICENSED FOR CPU SERIAL NUMBER 14F83, MODEL 2827 705             LICENSE/PRODUCT EXPIRATION DATE: 01 AUG 2018
  SYSIN :                                                                                                               
      OPTION COPY                                                                                                       
  WER276B  SYSDIAG= 6041711, 10055737, 10055737, 3993525                                                                 
  WER164B  8,864K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,                                                     
  WER164B     0 BYTES RESERVE REQUESTED, 272K BYTES USED                                                                 
  WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                                                                       
  WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                                                         
  WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                                                         
  WER410B  7,836K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,                                               
  WER410B     0 BYTES RESERVE REQUESTED, 156K BYTES USED                                                                 
  WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                                                         
  WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                                                         
  WER416B  BSAM WAS USED FOR SORTIN                                                                                     
  WER416B  BSAM WAS USED FOR SORTOUT                                                                                     
  WER054I  RCD IN          0, OUT          0                                                                             
  WER169I  RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1                                                                         
  WER052I  END SYNCSORT - NF8160A2,STEP02,,DIAG=E000,6202,C80C,00C4,A8F2,4CAB,8A08,E4E0                                 
1 SYNCSORT FOR Z/OS  1.3.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSORT INC.   DATE=2015/146   TIME=16.42.16
                                      AMERICAN EXPRESS   TRS   IPC   z/OS   1.13.0                                       
  SYNCSORT LICENSED FOR CPU SERIAL NUMBER 14F83, MODEL 2827 705             LICENSE/PRODUCT EXPIRATION DATE: 01 AUG 2018
  SYSIN :                                                                                                               
      OPTION COPY                                                                                                       
  WER276B  SYSDIAG= 6041711, 10055737, 10055737, 3993525                                                                 
  WER164B  8,864K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,                                                     
  WER164B     0 BYTES RESERVE REQUESTED, 272K BYTES USED                                                                 
  WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                                                                       
  WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                                                         
  WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                                                         
  WER410B  7,836K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,                                               
  WER410B     0 BYTES RESERVE REQUESTED, 156K BYTES USED                                                                 
  WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                                                         
  WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                                                         
  WER416B  BSAM WAS USED FOR SORTIN                                                                                     
  WER416B  BSAM WAS USED FOR SORTOUT                                                                                     
  WER054I  RCD IN          0, OUT          0                                                                             
  WER169I  RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1                                                                         
  WER052I  END SYNCSORT - NF8160A2,STEP02,,DIAG=E000,6202,C80C,00C4,A8F2,4CAB,8A08,E4E0
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 26, 2015 4:29 pm    Post subject: Reply with quote

iamgsundar,

Unfortunately you are running syncsort which is a competitive product to DFSORT. So I cannot answer your question. However I already gave you a hint about solving the problem.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
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 -> Job Control Language(JCL) 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