Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add a Unique Row Index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Add a Unique Row Index
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: 8593
Location: Back in jolly old England

PostPosted: Mon Oct 19, 2009 3:10 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Oct 19, 2009 9:06 pm    Post subject:
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:

http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us