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
 

 

Splitting a variable lenght file into three variable lenghth

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Sun Jun 28, 2009 8:24 am    Post subject: Splitting a variable lenght file into three variable lenghth
Reply with quote

Dear Experts,
While working on production problem I cam e across a situation where one of the input variable lenght file(gdg) 2004 lenght was having one record corrupt because of this corrupt record the job did not processed the complete file record and there were around 800 records unprocessed.

For the time being I manually deleted the corrpout record and feeded the rest unprocessed record to the job next day with override.

Now I have some time and was thinking how to split my single file in three files using dfsort.
Say for example my input file of VB lenght is having 3000 records and I want this file to be split in three files as per followinmg condition
assuming bad record starts at position 9 of file and lenght is 18.

a)All records in the file above this record should be copied to file1
b)This bad record should be copied to a seperate file
c)All the recordsd below this bad record should be copied to file3.

Before posting this I did a little search on forum for the possible thread but I am sorry I was not having much time to do this,so if already anything like this is there please pass me the link.
Thanks!
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Jun 28, 2009 9:13 am    Post subject:
Reply with quote

Hello,

See if this earlier solution will help:
http://ibmmainframes.com/viewtopic.php?t=40837

or either of the solutions here:
http://ibmmainframes.com/viewtopic.php?t=40255
Back to top
View user's profile Send private message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Mon Jun 29, 2009 9:59 pm    Post subject:
Reply with quote

Dear Dick,
Thanks for posting the thread.This is a feasible solution but I do not want the JCL to be the record position specific in file!!
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: Mon Jun 29, 2009 10:20 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed when you said position 9, you were not counting the RDW in positions 1-4, so the actual position is 13. I also assumed the bad record had 'BAD' in positions 13-30. The job can be changed appropriately if my assumptions are incorrect.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VB)
//CTL2CNTL DD DSN=&&C2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1 (VB)
//OUT2 DD DSN=...  output file2 (VB)
//OUT3 DD DSN=...  output file3 (VB)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) USING(CTL2)
//CTL1CNTL DD *
  INREC BUILD=(1,4,5:SEQNUM,8,ZD,START=0,13:13,18)
  OUTFIL FNAMES=CTL2CNTL,VTOF,
    INCLUDE=(13,18,CH,EQ,C'BAD'),
    BUILD=(C'  OUTFIL FNAMES=OUT1,ENDREC=',5,8,80:X,/,
     C'  OUTFIL FNAMES=OUT2,STARTREC=',5,8,ZD,ADD,+1,TO=ZD,LENGTH=8,
     C',ENDREC=',5,8,ZD,ADD,+1,TO=ZD,LENGTH=8,/,
     C'  OUTFIL FNAMES=OUT3,STARTREC=',5,8,ZD,ADD,+2,TO=ZD,LENGTH=8)
/*
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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