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

Add a Unique Row Index


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

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Mon Oct 19, 2009 2:56 pm
Reply with quote

Hi All,

I want to add a Unique Row Index (Line number is the best Unique Row Index to me). Is there any method in DFSORT my means of which, we can easily add the same to my record.

Let us assume my input as
Code:

AAA
BBB
CCC


I want the Output as:
Code:

AAA00001
BBB00002
CCC00003


Thanks in advance for your help.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Oct 19, 2009 3:10 pm
Reply with quote

What is the RECFM and LRECL of the input dataset.
How many records do you estimate will be in the file.

The code below works for me - adding a space and a 5 byte sequence number to the end of a 60 byte FB record
Code:

  OPTION COPY                         
  OUTREC BUILD=(1,60,1X,SEQNUM,5,ZD)   
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Mon Oct 19, 2009 3:22 pm
Reply with quote

The RECFM is FB and the LRECL is 82.

So, the code that should work for me (without the space) should be:
Code:

OPTION COPY
OUTREC BUILD=(1,82,SEQNUM,10,ZD)


Please correct me if I have gone wrong in my understading.

Thanks for your help.
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: Mon Oct 19, 2009 9:06 pm
Reply with quote

That will work, but you can do it more simply with DFSORT's OVERLAY function like this:

Code:

   OPTION COPY
   OUTREC OVERLAY=(83:SEQNUM,10,ZD)


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
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Tue Oct 20, 2009 10:30 am
Reply with quote

Thank you Frank for providing this Tutorial..

Thank you all for providing the quick responses as the solutions provided by you all worked for me...
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 Cobol file using index COBOL Programming 2
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Any JCL or VSAM Utility to get number... JCL & VSAM 1
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts choice of clustering index DB2 3
Search our Forums:

Back to Top