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

Splitting a variable lenght file into three variable lenghth


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

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

Hello,

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

or either of the solutions here:
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
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 Developer


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

PostPosted: Mon Jun 29, 2009 10:20 pm
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 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