Split File based on Record Type Grouping
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: Split File based on Record Type Grouping Author: iamgsundar PostPosted: Tue May 26, 2015 2:26 pm
    —
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>

#2: Re: Split File based on Record Type Grouping Author: kolusuLocation: San Jose PostPosted: Tue May 26, 2015 3:20 pm
    —
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           
//* 

#3:  Author: iamgsundar PostPosted: Tue May 26, 2015 3:52 pm
    —
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

#4:  Author: kolusuLocation: San Jose PostPosted: Tue May 26, 2015 4:29 pm
    —
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.



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group