Significance of the sequence number in COBOL.
Significance of the sequence number in COBOL.
I read that Cobol kept the first 6 positions for a line sequence number. Column 7 was a continuation / comment / debug / form-feed. Area "A", or Columns 8-11, indicated certain special language artifacts like 01 levels, section or paragraph names. Columns 73 - 80 were for OS sequence numbers.
i have also notied some programs have it some don't; some have them in no particular sequence... when a program can compile and run with or without them, what is their use for the program?
i have also notied some programs have it some don't; some have them in no particular sequence... when a program can compile and run with or without them, what is their use for the program?
Re: Significance of the sequence number in COBOL.
Sequence numbers are irrelevant nowadays. They were useful if you dropped the cards that the code was punched on so that you could put them back together in the correct sequence.
Regards
Nic
Nic
Re: Significance of the sequence number in COBOL.
Whenever I encounter a source deck with all numerics in cols 1-7, one of the first things I do is to immediately overlay those lines with spaces. I actually wrote a source code processing program to do exactly that. Better to have nothing at all than have something that means nothing.
Re: Significance of the sequence number in COBOL.
I hope that was cols 1 - 6 and not 7!
We used cols 1-6 for notes e.g. to flag lines that were in for DEBUG or TEST (and col 7 = D).
We used cols 1-6 for notes e.g. to flag lines that were in for DEBUG or TEST (and col 7 = D).
Regards
Nic
Nic
Re: Significance of the sequence number in COBOL.
Can you please share the code, if it can be shared here?ApexNC wrote:I actually wrote a source code processing program to do exactly that.
Re: Significance of the sequence number in COBOL.
How about a two line macro that simply changes any non-blank character in cols 1 to 6 to blank? The first line would be the MACRO header.
Regards
Nic
Nic
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Significance of the sequence number in COBOL.
In the ISPF Editor:
That will clobber anything in columns one to six. Not a lot of people know about NUMBER ON COBOL, so just tossing it in.
I have seen columns one to six used for various things, never really with much point.
You can have columns one to six checked by the compiler, or contents entirely ignored. See compiler options NUMBER and SEQUENCE.
Code: Select all
NUMBER ON COBOL
UNNUM
NUMBER <back to previous state, if necessary>
I have seen columns one to six used for various things, never really with much point.
You can have columns one to six checked by the compiler, or contents entirely ignored. See compiler options NUMBER and SEQUENCE.
Re: Significance of the sequence number in COBOL.
Here's the essential code (for fixed-length COBOL source files), based on the recently posted GET/PUT Assembler shell format (posted under the Convert "VB to FB file but with padding" topic Re: Convert VB to FB file but with padding. (Post by Anonymous #8285) ):alpna wrote:Can you please share the code, if it can be shared here?ApexNC wrote:I actually wrote a source code processing program to do exactly that.
Code: Select all
BLKSEQ CSECT
BAKR 14,0
LR 12,15
USING BLKSEQ,12
PRINT NOGEN
OPEN (COBSRC,UPDAT) OPEN COBOL SOURCE FILE
LOOP GET COBSRC R1 -> COBOL SOURCE RECORD
TRT 0(6,1),TRTBL COBOL SEQUENCE ALL NUMERIC?
BNZ LOOP NO: GO GET NEXT COBOL SOURCE RECORD
MVC 0(6,1),SPACES YES: OVERLAY SEQUENCE NUMBER WITH SPACES
PUTX COBSRC UPDATE RECORD
B LOOP DO WHILE MORE COBOL SOURCE RECORDS
EOF CLOSE COBSRC AT END, CLOSE COBOL SOURCE FILE
PR RETURN
COBSRC DCB DSORG=PS,DDNAME=COBSRC,MACRF=(GL,PL),EODAD=EOF
* NEXT 256 BYTES IS THE TRANSLATE TABLE FOR TRT
TRTBL DC CL240' ' FOR X'00' TO X'EF'
DC XL10'00' FOR X'F0' TO X'F9' (ZONED DECIMAL DIGITS)
SPACES DC CL6' ' FOR X'FA' TO X'FF'
END
Here's the JCL:
Code: Select all
// EXEC PGM=BLKSEQ
//COBSRC DD DISP=SHR,DSN=<dsname of COBOL source file>
Re: Significance of the sequence number in COBOL.
Thanks so much for you help ApexNC.ApexNC wrote:Here's the essential code (for fixed-length COBOL source files), based on the recently posted GET/PUT Assembler shell format (posted under the Convert "VB to FB file but with padding" topic Re: Convert VB to FB file but with padding. (Post by Anonymous #8285) ):alpna wrote:Can you please share the code, if it can be shared here?ApexNC wrote:I actually wrote a source code processing program to do exactly that.For variable length COBOL source files, change "0(6,1)" to "4(6,1)" in the TRT and MVC instructions.Code: Select all
BLKSEQ CSECT BAKR 14,0 LR 12,15 USING BLKSEQ,12 PRINT NOGEN OPEN (COBSRC,UPDAT) OPEN COBOL SOURCE FILE LOOP GET COBSRC R1 -> COBOL SOURCE RECORD TRT 0(6,1),TRTBL COBOL SEQUENCE ALL NUMERIC? BNZ LOOP NO: GO GET NEXT COBOL SOURCE RECORD MVC 0(6,1),SPACES YES: OVERLAY SEQUENCE NUMBER WITH SPACES PUTX COBSRC UPDATE RECORD B LOOP DO WHILE MORE COBOL SOURCE RECORDS EOF CLOSE COBSRC AT END, CLOSE COBOL SOURCE FILE PR RETURN COBSRC DCB DSORG=PS,DDNAME=COBSRC,MACRF=(GL,PL),EODAD=EOF * NEXT 256 BYTES IS THE TRANSLATE TABLE FOR TRT TRTBL DC CL240' ' FOR X'00' TO X'EF' DC XL10'00' FOR X'F0' TO X'F9' (ZONED DECIMAL DIGITS) SPACES DC CL6' ' FOR X'FA' TO X'FF' END
Here's the JCL:Code: Select all
// EXEC PGM=BLKSEQ //COBSRC DD DISP=SHR,DSN=<dsname of COBOL source file>
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute