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

JCL utility for replicating records with condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vivek_elx

New User


Joined: 18 Feb 2009
Posts: 4
Location: India

PostPosted: Wed Feb 18, 2009 4:38 pm
Reply with quote

Hi..
Is there any utility by which we can replicate records of a file with changing a record field everytime so that the records are not duplicate.
for example
consider a record
aaa001bbbccc....
we want to replicate this record in the file 1000 times with just changing the numerical sequence like
aaa001bbbccc....
aaa002bbbccc....
aaa003bbbccc....
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Feb 18, 2009 5:25 pm
Reply with quote

Yes, SORT for one.....
Also look at the IEBDG (Test Data Generator) Program....
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Wed Feb 18, 2009 10:08 pm
Reply with quote

yes buddy...
use ICETOOL...sample code is given below:

INREC OVERLAY=(<change pos>:SEQNUM,8,ZD,START=<start value,INCR=<increment value>)

for details look into the ICETOOL guide...
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Wed Feb 18, 2009 10:32 pm
Reply with quote

Hi,
The SEQUNUM will help to create the sequence number as per your requirement.The same will work if you have SYNCSORT.


Thanks
Krishy
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: Wed Feb 18, 2009 10:55 pm
Reply with quote

If you start at 001 and create 1000 records, the last record will have 000.
That said, you can use a DFSORT job like this:


Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
aaa001bbbccc....
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REPEAT=1000,OVERLAY=(4:SEQNUM,3,ZD)
/*


If you want to start at 000 instead of 001, you can use:

Code:

  OUTFIL REPEAT=1000,OVERLAY=(4:SEQNUM,3,ZD,START=0)
Back to top
View user's profile Send private message
vivek_elx

New User


Joined: 18 Feb 2009
Posts: 4
Location: India

PostPosted: Tue Feb 24, 2009 4:29 pm
Reply with quote

Thanks Frank , the DFSORT job provided by you worked fine icon_razz.gif when SORTIN was defined as
//SORTIN DD *
aaa001bbbccc....

when I tried to use a DSN for the same like-

//SORTIN DD DSN=ABC.DEF.XYZ,
// DISP=SHR

it gave an error as
OPTION COPY
*
INREC REPEAT=500,OVERLAY=(4:SEQNUM,3,ZD,START=1,INCR=1)
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT

...what are the keywords its asking for ..im confused icon_exclaim.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Feb 24, 2009 4:44 pm
Reply with quote

vivek_elx,

Dint you notice that you have changed the
Code:
OUTFIL REPEAT
to
Code:
INREC REPEAT

Change it back to OUTFIL. Also by default your sequence number starts from 1 and gets incremented by 1; so I think you dont need the "START=1,INCR=1" part.
Back to top
View user's profile Send private message
vivek_elx

New User


Joined: 18 Feb 2009
Posts: 4
Location: India

PostPosted: Tue Feb 24, 2009 4:50 pm
Reply with quote

Thanks alot Arun...its working now...
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Feb 24, 2009 8:52 pm
Reply with quote

Also, Vivek, the WER... messages you received indicates you have Syncsort, not DFSORT or CA-SORT or whatever.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top