IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Split a variable block file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Fri Sep 10, 2010 11:42 am
Reply with quote

I have a variable block file having records as:

${1:F01NWBKGBCEAXXX4339285235}
{2:O0812301100510ABMOXXXXGXXX00002205371005110616S}
{4:
{202:0001}
{203:0001}
{305:A}
{331:433710051006151005101748000
{331:433810051017501005101920000
{332:000332000016}
{305:B}
{331:278510051006151005101749000
{331:278610051017501005101920000
{332:000325000413}
{305:C}
{332:000000000000}
{305:D}
{332:000000000000}}
{5:
{CHK:23FE841BCEAC}
{SYS:}}
${1:F01NWBKGBCEAXXX4339285243}

$ marks the beginning of a record. Now because of the volume, I want to split the file into multiple files. Condition we have is:
First 'x' no. of records to 1st file, followed by 'y' no. of records to 2nd file and remaining to 3rd file

How do we logically break the file into different files so that the records (separated by '$') remain intact.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Fri Sep 10, 2010 1:03 pm
Reply with quote

Assuming u need to move 500 data records to first 2 files and remaining to third file

Code:

  OPTION COPY                                                       
  INREC BUILD=(1,4,8X,5)                                             
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(13,1,CH,EQ,C'$'),PUSH=(5:ID=8))   
  OUTFIL FNAMES=FILE1,INCLUDE=(5,8,ZD,LE,500),BUILD=(1,4,13)           
  OUTFIL FNAMES=FILE2,INCLUDE=(5,8,ZD,GT,500,AND,5,8,ZD,LE,1000),BUILD=(1,4,13)
  OUTFIL FNAMES=FILE3,SAVE,BUILD=(1,4,13)         


but i would like to know if the PUSH could have been to INREC so that i dont need to use INREC and OUTREC together ?
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Fri Sep 10, 2010 1:55 pm
Reply with quote

you can remove the inrec part as follows icon_smile.gif

Code:

   OPTION COPY         
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,8X,5)),                             
       IFTHEN=(WHEN=GROUP,BEGIN=(13,1,CH,EQ,C'$'),PUSH=(5:ID=8))       
   
  OUTFIL FNAMES=FILE1,INCLUDE=(5,8,ZD,LE,500),BUILD=(1,4,13)           
  OUTFIL FNAMES=FILE2,INCLUDE=(5,8,ZD,GT,500,AND,5,8,ZD,LE,1000),BUILD=(1,4,13)
  OUTFIL FNAMES=FILE3,SAVE,BUILD=(1,4,13)   
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Sep 10, 2010 10:36 pm
Reply with quote

Pankaj,

It isn't clear to me what you want to do or if the posted solution will do it.

What is the RECFM and LRECL of your input file?

You talk about a "record" starting with $ - do you mean a group of records? Do you want to move each group of records to a different file?
How does "First 'x' no. of records to 1st file, etc" relate to the groups of records? Do you really mean "first group of records, starting with $, to 1st file, etc"?

Please show an example of the records in your input file (more than one set) and what you expect for the output files. Explain the rules for getting from input to output.

In the future, please spend the time to describe what you want to do more clearly with good examples.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top