View previous topic :: View next topic |
Author |
Message |
kirank Beginner
Joined: 21 Apr 2004 Posts: 61 Topics: 33 Location: hyderabad
|
Posted: Thu Apr 26, 2007 8:57 am Post subject: Change a Field to another field in a file |
|
|
Hi,
Please clarify the following doubt.
I've a file which is having three fields and they contain data as follows:
Name Number salary
John 1000 20000
John 1000 20000
John 1000 20000
Now, i want the output as follows:
Name Number salary
Johnk 1000 20000
Johnk 1000 20000
Johnk 1000 20000
Here i want to replace 'John' with 'Johnk'. Initially, the name field is of
x(5).
Please let me know that can we do this with JCL? Please send me the JCL
for the above requirement.
Thanks,
Kiran.
Edited by admin : Please post your questions with meaningful titles. If you violate this rule or any other board rules you WILL be banned |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Apr 26, 2007 9:04 am Post subject: |
|
|
No you cannot - JCL does not manipulate data - it lets the mainframe know what resources your program needs. It is your program that manipulates the data. You probably want ICETOOL (if you use DFSORT) or the SYNCSORT equivalent. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu Apr 26, 2007 9:04 am Post subject: Re: Doubt in JCL |
|
|
Kiran,
You have to provide the LRECL.
Anyway assuming the length as 80, the below code will solve your problem.
Code: | //S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:1,4,5:C'K',6:6,80)
/*
//SORTIN DD DSN=your input file,DISP=SHR
//SORTOUT DD DSN=output file,DISP=SHR
/*
//* |
|
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Apr 26, 2007 9:05 am Post subject: |
|
|
Quote: | Please let me know that can we do this with JCL? |
Strictly speaking the answer is NO. JCL is job control language which is only used to invoke the program of choice. It is the program that actually does the work, not the JCL. You can use JCL to invoke SORT or REXX which coded correctly would give you the desired result.
Quote: | Please send me the JCL for the above requirement. |
Please send payment for coding services. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Apr 26, 2007 9:38 am Post subject: |
|
|
kirank,
with 36 posts and 21 topics, is it not time you learned to use a decent title for your thread. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Apr 26, 2007 11:39 am Post subject: |
|
|
Kiran,
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
John 1000 20000
John 1000 20000
John 1000 20000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(5:C'K')
/*
|
_________________ 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 |
|
|
kirank Beginner
Joined: 21 Apr 2004 Posts: 61 Topics: 33 Location: hyderabad
|
Posted: Fri Apr 27, 2007 12:32 am Post subject: |
|
|
Hi all,
Thanks for your replies and sorry for the bad title.
Thanks,
Kiran. |
|
Back to top |
|
|
|
|