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
generating sequence number starting from 0100000000000000
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 4
- Joined: Wed Aug 23, 2006 10:37 am
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 4
- Joined: Wed Aug 23, 2006 10:37 am
RE:generating sequence number starting from 0100000000000000
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
Can you provide me any alternative way to solve this problem
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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.Can you provide me any alternative way to solve this problem
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page