Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us