generating sequence number starting from 0100000000000000

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
rajendra.pallala
Member
Posts: 4
Joined: Wed Aug 23, 2006 10:37 am

generating sequence number starting from 0100000000000000

Post by rajendra.pallala » Wed Nov 29, 2006 2:14 pm

Using sort utility

I need to generate output field with 16 digit number, start with 0100000000000000 and for each record, increment the last digit by 1, so the next would be 0100000000000001, then 0100000000000002 and so on for all records.

I tried with SEQNUM and START combination, but limit of START value is 100000000000

Any alternative for this.

Please help me I need to do this very urgently

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Nov 29, 2006 10:58 pm

Well, if you don't expect more than 99,999,999,999,999 records, you could just make the first '01' a constant and use SEQNUM with 14 digits starting at 0. For example, you could use this DFSORT statement to put the sequence number in columns 81-96.

Code: Select all

  OPTION COPY                                     
  OUTREC OVERLAY=(81:C'01',SEQNUM,14,ZD,START=0)  
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

rajendra.pallala
Member
Posts: 4
Joined: Wed Aug 23, 2006 10:37 am

RE:generating sequence number starting from 0100000000000000

Post by rajendra.pallala » Thu Nov 30, 2006 9:19 am

But According to client requirement we have to use 16 digit sequence number. We are not sure how many records exist.

Can you provide me any alternative way to solve this problem

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Nov 30, 2006 5:32 pm

who has 99 trillion of anything?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Nov 30, 2006 8:58 pm

Can you provide me any alternative way to solve this problem
As you said, 100000000000 is the largest START value you can use. I can't think of another way, other than writing a program or exit.

It's difficult to believe you would actually have enough records so what I suggested wouldn't work.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others