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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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