MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change a Field to another field in a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Thu Apr 26, 2007 8:57 am    Post subject: Change a Field to another field in a file Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Apr 26, 2007 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Apr 26, 2007 9:04 am    Post subject: Re: Doubt in JCL Reply with quote

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
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Apr 26, 2007 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Apr 26, 2007 9:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Apr 26, 2007 11:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Fri Apr 27, 2007 12:32 am    Post subject: Reply with quote

Hi all,

Thanks for your replies and sorry for the bad title.


Thanks,
Kiran.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group