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

A question on editing records using sorts


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Tue Nov 23, 2010 3:53 pm
Reply with quote

Hi All,

I need help as mentioned below:

Input file

Location Company Year

001 abc 2008
002 xyz 2009


Output file

Location Company Year

001 abc 2009
002 xyz 2010

Assuming that the file has one thousand records ,please suggest how can we edit the records using sort utility.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 23, 2010 4:03 pm
Reply with quote

This has been asked and answered before

Click HERE to see what you might have found yourself had you bothered to search.
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 Nov 24, 2010 12:47 am
Reply with quote

Mukesh,

Assuming you want to add 1 to the field in positions 23-26, you can use a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
001       abc         2008
002       xyz         2009
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC OVERLAY=(23:23,4,ZD,ADD,+1,EDIT=(TTTT))
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Thu Dec 09, 2010 12:05 am
Reply with quote

Thanks Expat and Frank.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top