IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Line number from position 1 thru 6 in COBOL program


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu May 14, 2009 6:59 pm
Reply with quote

Hi,

In Cobol program we generate sequence numbers from pos 1 to 6 using the command 'num on std cob' as below. (Our shop uses Endevor)

Code:

000010 000010 ID DIVISION.
000020 000020 PROGRAM-ID.    XXXXXXXX.
000030 000030 AUTHOR.        YYYYY YYYYYY.
000040 000040 INSTALLATION.  ZZZZ.
000050 000050 DATE-COMPILED.


But this is in the order of 10 incremented by 10.

Is there any way we can generate the sequence numbers from 1 incremented by 1 as follows.

Code:

000010 000001 ID DIVISION.
000020 000002 PROGRAM-ID.    XXXXXXXX.
000030 000003 AUTHOR.        YYYYY YYYYYY.
000040 000004 INSTALLATION.  ZZZZ.
000050 000005 DATE-COMPILED.


Please let me know if my query is not that clear.

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 14, 2009 7:12 pm
Reply with quote

used to be, RENUM .zf .zl 1 1 (or something like that, you will have to look it up, I am too lazy and always use num off.)

PF1 while in EDIT Session, look for RENUM for correct syntax

depending upon the IMACRO you are using, (or forced to use), the program maybe renumbered - according to site standards - upon save.

why do you want the numbering to be incremented by 1????????

especially since newer (since 1980) systems don't use the sequence number anyway.
Back to top
View user's profile Send private message
santosh.ambaprasad

New User


Joined: 08 Mar 2009
Posts: 16
Location: London

PostPosted: Fri May 15, 2009 2:44 am
Reply with quote

Hi

I have no cue why this numbers are to be incremented by 1.
But ... yes there is a solution... using DFSORT
try this..

//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=CBLPROG,DISP=SHR
//SORTOUT DD DSN=CBLPROG.UPD,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(SEQNUM,6,ZD,X,8,73)
SORT FIELDS=COPY

SORTIN is where your current cobol program should sit.
I assume you are writing cobol p0ogram in a file of LRECL 80.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri May 15, 2009 4:31 am
Reply with quote

What happens to statements that are not blank in col 7?
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri May 15, 2009 8:43 am
Reply with quote

Quote:
especially since newer (since 1980) systems don't use the sequence number anyway.

But what if I drop my deck of cards? icon_lol.gif
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Fri May 15, 2009 8:49 am
Reply with quote

ok I will try with RENUM options.

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top