View previous topic :: View next topic |
Author |
Message |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Tue Jan 20, 2004 9:32 am Post subject: Editing Line Numbers |
|
|
Hi All ,
When I write COBOL Code using ISPF Edit panel and have also set the NUM ON STD COB .. why can I still not Change the Line numbers (for documentation puposes) ?
What I mean to say is when a cobol program is Edited you get Line numbers on both the Sides and the Code in the middle ..right ? What I was trying to do is over-write the Line numbers on LHS ..with the Date of change...it lets me over-write the numbers but this Change is not Saved !!! (all other code changes reflect correctly). If this has to do with the Profile ..heres what mine looks like currrently
....SOURCE (FIXED - 80)....RECOVERY OFF NOWARN....NUMBER ON STD COB...
....CAPS ON....HEX OFF....NULLS ON STD....TABS OFF....................
....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON............
....PROFILE UNLOCK....IMACRO NONE....PACK OFF....NOTE ON..............
....HILITE OFF CURSOR FIND............................................
My other question is why are the Line numbers on LHS of 6 digits and that on RHS of 8 ?!! We almost never use the RHS Line numbers for anything ...but make use of the LHS line numbers by placing a * in Col 7 (comment line) and then replacing the line number.
Thnks
vini |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Jan 20, 2004 10:20 am Post subject: |
|
|
Vini,
You can save linenumbers on the LHS by typing NUM OFF. For example the following is the number seq with NUM ON STD COB.
Code: |
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. SAMPLE.
000300 AUTHOR. KOLUSU.
000400 DATE-WRITTEN. 01/20/2004.
000500 ...
|
If I understood correctly you want change the LHS numbers with current date(mmddyy)for changes you made to the code.
Code: |
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. SAMPLE.
012004 AUTHOR. VINI. <==== edited line
000400 DATE-WRITTEN. 01/20/2004.
000500 ...
|
Inorder to save that number you need to have profile as NUM OFF and you can save the LHS numbers
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Tue Jan 20, 2004 11:10 am Post subject: |
|
|
Kolusu,
Yes , NUM OFF worked like you said ...but I am left wondering why should folks even use this method of documentation ?!!!
Thereafter ..if anyone was to reset profile back to NUM ON ...the date (mmddyy) is again refreshed by a Line Number in its place ! So theres noway to make the change there permanent ..right ?!
Actually its not like a standard here ..but I observed some folks do that and then thought it wasnt a bad idea .. but now I think othwerwise.
Thnks
vini. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Jan 20, 2004 12:07 pm Post subject: |
|
|
vini,
Most shops have version management software like panvalet, Endevor.... These packages maintain version numbers on the right hand side.
people follow different ways for documentation. I personally would not prefer that method for documentation.
I simply follow the following method.I will have my profile set to NUM ON STD COB and track my changes as shown below.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
AUTHOR. KOLUSU.
DATE-WRITTEN. 01/20/2004.
....
******************************************************************
* DESCRIPTION: COMMENTS DESCRIBING THE PROGRAM IN BRIEF *
* *
******************************************************************
* PROGRAM CHANGE LOG: *
* *
* DATE REF# DESCRIPTION *
* ---------- -------- --------------------------------- *
* 01/10/2004 ORIGINAL CREATION DATE. *
* 01/15/2004 SK001 ADDED A NEW COUNTER FOR DROPPED RECS *
* 01/20/2004 VA002 CHANGED THE COMPUTE STATEMENT TO ROUND *
******************************************************************
......
******************************************************************
WORKING-STORAGE SECTION.
******************************************************************
....
**SK001 - START
01 WS-RECS-DROP-COUNTER PIC +9(09) VALUE ZEROES.
**SK001 - END
.....
*va002 - START
COMPUTE WS-VARC ROUNDED = (WS-VARA + WS-VARB)/ WS-FACTOR
*va002 - END
...
|
Now it is easier to track all changes as well as to who did it
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
RobertL Beginner
Joined: 18 Nov 2003 Posts: 22 Topics: 0 Location: Lisbon, Portugal
|
Posted: Tue Jan 20, 2004 1:43 pm Post subject: |
|
|
If you set your profile to NUM ON STD, then line numbers will be maintained for you on the right hand side. You will then be free to update the numbers on the left hand side as you see fit.
Regards,
Robert
|
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Tue Jan 20, 2004 2:18 pm Post subject: |
|
|
Kolusu ,
The example you gave is more commonly followed as a standard here too...but like I said there were some trying to take a short cut by editing line numbers. I would also stick by that method u describe. We use SCLM for version control.
Robert,
I found that both 'NUM ON STD' and 'NUM OFF' have identical affect ..let you save the change and on any subsequent issuance of a NUM ON STD COB ...the change gets refreshed back with a line number !
Wondering whats basicaly the difference between a NUM ON STD and a NUM OFF
Thnks.
Vini |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Wed Jan 21, 2004 7:10 am Post subject: |
|
|
NUM ON STD maintains line numbers in cols 73-80 and expects valid sequence numbers in order. NUM OFF doesn't care what is in these cols and allows you to put what you like in them. |
|
Back to top |
|
|
RobertL Beginner
Joined: 18 Nov 2003 Posts: 22 Topics: 0 Location: Lisbon, Portugal
|
Posted: Wed Jan 21, 2004 1:18 pm Post subject: |
|
|
NUM OFF tells ISPF edit that there are no line numbers in this member. Any changes to the line number fields are accepted as if it is normal data.
NUM ON STD tells ISPF edit that there are line numbers between cols 73-80 and that it should not allow you to edit these columns.
What is happening to you is one of those (sometimes) annoying little quirks with ISPF edit. Any time you start an edit session, ISPF edit will check the profile NUM option and compare it to the actual data. If it recognizes that a member has valid line numbers in columns 1-6, it automatically turns on the edit profile NUM option to NUM ON COB. If it finds valid line numbers in 1-6 and 73-80 it will turn on NUM ON STD COB. I do not know of any way to change this behaviour.
This means, as long as columns 1-6 have what appear to be valid line numbers, you will have to set NUM ON STD (or NUM OFF) each time you start a new edit session.
As an alternative, you could change all of the data in columns 1-6 to spaces and only put the change date on the lines that have been changed. This way ISPF will find that the member does not have valid line numbers in 1-6 and will not change the profile to NUM ON COB.
Hope this helps.
Regards,
Robert |
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Wed Jan 21, 2004 2:02 pm Post subject: |
|
|
Mike ,
Appreciate the info ... sometimes in IT we are issuing commands or settings so mechanically that we even forget the basic purpose behind them .. thats what happened to me. Thnks.
Robert,
I did not see the Profile changing like you mentioned ..it changes only when I issue a change after re-opening of same file.
Regardless we know for sure using Line numbers for documentation is not a recomended method and has these loopholes to contend.
Thnks.
vini. |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu Jan 22, 2004 11:01 am Post subject: |
|
|
Personally, every time I edit a COBOL program I do
NUM ON STD COB
UNNUM
which blanks out both sorts of line numbers, valid or invalid, because I just find them a pain in the ****. But we don't use these line number fields for anything to do with change control etc. so I can do this without worrying.. |
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Jan 22, 2004 4:58 pm Post subject: |
|
|
Mike ,
With what you mentioned the Line numbers on the LHS still remain . Isnt there a way to eliminate the numbers on both the ends ? ( havent tried ..assumed theyre there for good reason)
They normally dont bother me on m/f ..but when I download pgms sometimes to dry run them from a PC Print out ..they sure do bother .
Thnks
vini |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Thu Jan 22, 2004 6:14 pm Post subject: |
|
|
I don't believe there's a good reason for line numbers these days. It used to be normal here to use cols 73-80 for comments about changes, but I think I've finally managed to stamp it out.
Once you've convinced Edit you don't want line numbers, you can get rid of any left over rubbish in 73 to 80 with:
C ALL 73 80 P' _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Tue Jan 27, 2004 9:55 am Post subject: |
|
|
vini, you said
Quote: |
Mike ,
With what you mentioned the Line numbers on the LHS still remain . Isnt there a way to eliminate the numbers on both the ends ? ( havent tried ..assumed theyre there for good reason)
|
In my setup both sets of line numbers are removed correctly. Are you editing an FB 80 dataset with the standard ISPF editor? You should get the same results as me in that case. I think it will vary for other record lengths or VB records however. |
|
Back to top |
|
|
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Tue Jan 27, 2004 1:49 pm Post subject: |
|
|
Mike,
The DS I was editing was also FB 80 (Cobol source code) ..BUT as Mervyn mentions above theres a solution by the C ALL ..
vini |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Wed Jan 28, 2004 7:01 am Post subject: |
|
|
Well, I'm totally baffled as to why you should get different results to me in that case. |
|
Back to top |
|
|
|
|