Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Split a variable block file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Split a variable block file
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Sep 10, 2010 10:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us