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

Update the fields of records using dfsort


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

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Wed Feb 27, 2008 5:03 pm
Reply with quote

Hi ,

I am having an input file having length x(10).
It contains two fields.

Group code X(5) and Plan Code X(5).

If group code = 00001 then i need to update its plan code with 0002 and similarly group code = 00023 then i need to update its plan code with 0009.Can any one throw some lite on this please.
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 27, 2008 8:21 pm
Reply with quote

Have you looked at DFSORT's IFTHEN parameter?
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 27, 2008 10:44 pm
Reply with quote

sri_mf,

If Plan code is 5 bytes, I assume you want '00002' rather than '0002' and '00009' rather than '0009'.

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 *
0000199999
0000299999
0002399999
0000100035
0002388888
0000288888
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'00001'),OVERLAY=(6:C'00002')),
        IFTHEN=(WHEN=(1,5,CH,EQ,C'00023'),OVERLAY=(6:C'00009'))
/*


For the example, SORTOUT will have:

Code:

0000100002
0000299999
0002300009
0000100002
0002300009
0000288888


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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Thu Feb 28, 2008 1:04 pm
Reply with quote

Thank u verymuch Frank for ur fast reply.
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 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top