I am sorting one file using sort utility , i will sort this file only if i get a request so when i get a first request then i will sort the file and then we will put the header and trailer.
Header & Trailer will consist of sequence number
so for first request sequence number will be one. When i get a second request i should sort the file again and should increment sequence number to two.
For incrementing the sequence number i dont want to write any cobol program.
Can anybody sugget how we can increment sequence number using sort utility.
The header record will be having the Record Type,application name(4 bytes), sequence no(6 bytes),date,time. The trailor record contains the application name(4 bytes), sequence no(6 bytes),record count(7 bytes). I have created everything except the sequence number. I am not sure how to add the sequence number. The LRECL is 30 and the RECFM is FB.
The Header Record layout follows below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Data Element Positions Length Format
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Record Type 1 – 3 3 ‘BOF’
Blank 4 1 Blank
Sending System 5 – 8 4 ‘ABCD’
Blank 9 – 10 2 Blank
Sequence Number 11 – 16 6 Numeric
Blank 17 1 Blank
Date 18 – 23 6 YYMMDD
Blank 24 1 Blank
Time 25 – 30 6 HHMMSS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Trailer Record layout follows below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Data Element Positions Length Format
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Record Type 1 – 3 3 ‘EOF’
Blank 4 1 Blank
Sending System 5 – 8 4 ‘ABCD’
Blank 9 – 10 2 Blank
Sequence Number 11 – 16 6 Numeric
Blank 17 1 Blank
Record Count 18 – 24 7 Numeric
Blank 25 – 30 6 Blank