View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Fri Aug 17, 2007 9:33 am Post subject: want to replace records from certain postion |
|
|
Hi ,
I want to replace records from certain postion.
All the records have diifferent values in certain postion let say from 21st postion.
Suppose i have 5 records and all the five records have different values in 21st postion and now i want to change all the records from 21st postion to 30 postion to same values.
is there any way in sort we can do this.
lets take example
.......................21st
.......................mastercard.................
.......................visacard......................
.......................dinersclub....................
.......................barclays.......................
.......................suntrust........................
now i want
........................21 postion.......................
........................Amexcard......................
........................Amexcard......................
........................Amexcard......................
........................Amexcard......................
........................Amexcard......................
can any one help me
Thanks & regards,
Siva |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Aug 17, 2007 10:24 am Post subject: |
|
|
Quote: |
Suppose i have 5 records and all the five records have different values in 21st postion and now i want to change all the records from 21st postion to 30 postion to same values.
|
what if they are NOT different ? or a combo or 2 visa card and 3 of master card?
or any combo except being unique . what do you want to do in the scenario?
also what's up with 5 records? Do we need to treat every 5 records as 1 set?
What is the lrecl and recfm of the input and output files?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Aug 17, 2007 10:49 am Post subject: |
|
|
Kolusu,
I think Siva just wants to change positions 21-30 in every record regardless of what's there, and just wasn't too clear about it.
Siva,
Here's a DFSORT job to do that:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(21:C'Amexcard ')
/*
|
If that's not what you want, then please explain clearly what you do want. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Sat Aug 18, 2007 12:06 pm Post subject: |
|
|
Hi Frank..
I have to test the code.It looks this might work..
Thanks for ur help..
Thanks,
Siva |
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Wed Aug 22, 2007 12:52 am Post subject: |
|
|
Thanks Frank..
It worked ...
Once again thanks for ur help
Regards,
Siva |
|
Back to top |
|
|
|
|