Adding sequence no in VB file thru Syncsort

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Sathishkrishna
Member
Posts: 2
Joined: Sun Jun 28, 2015 2:37 am
Location: Chennai

Adding sequence no in VB file thru Syncsort

Post by Sathishkrishna » Sun Jun 28, 2015 2:48 am

I have a VB file with 32500 lrecl. i need to add 2 digit sequence no in 13th position of the file for each duplicate record. key length is 12 and the starting position is 1.

Input:
D00011111111 *01*1........
D00011111111 *01*1........
D00022222222 *01*1........

Expected:
D0001111111101 *01*1........
D0001111111102 *01*1........
D0002222222201 *01*1........

Note: Same file will be used as output and 13th & 14th positions are blank in the input. Just want to update the blank with 2 digit sequence no.

How this can be done in SORT?

Any help would be appreciated.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Jun 29, 2015 3:52 am

What do you mean by the same file will be used as output? To use the same DSN would be foolish.

Look at using INREC OVERLAY to put a SEQNUM of length 2 in the position you want with a RESTART on your key.

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