COBOL Change command

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
nagesh divvela
Member
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

COBOL Change command

Post by nagesh divvela » Sun Dec 27, 2009 12:42 pm

Hi all..

When we give the following statement in the command line
C ALL '##' $$'
it changes all the ## characters to $$ and also indicates the changed line by a label in the line no cols.

My question is how to skip from one changed line to the other...
Instead of scrolling through the total code is there any PF key functionality ?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sun Dec 27, 2009 11:43 pm

you could X ALL before the change.
otherwise you could try Find changed next
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

nagesh divvela
Member
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Post by nagesh divvela » Mon Dec 28, 2009 8:46 am

Thanks for that..

It is a good thought of giving a find for the changed string and then differentiating whether it was changed or not from the label "==CHG>" will do my need.

But I did not understand how X ALL would help in this context.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Dec 28, 2009 8:52 am

if you x all everything before the change. and then after you executed the chg, only the changed lines will be displayed.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

nagesh divvela
Member
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Post by nagesh divvela » Mon Dec 28, 2009 9:00 am

Thanks for the explanation...

When I give X all command it ade the lines non displayable..
- - - - - - - - - - - - - - - - - - - 2 Line(s) not Displayed

But later when I gave the C ALL PRG ARG..it has changed the string and is displaying the total code as it shows when we give a change command in direct code without giving the X ALL command.

Suggest me in brief where I am wrong.

Thanks

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Dec 28, 2009 10:16 am

C ALL PRG ARG
what is that?

if you are not editing or viewing the member/ds,
what facility are you using to make the change command.

in brief, you are not very informative.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
vrajx
Member
Posts: 3
Joined: Thu Dec 24, 2009 2:51 pm

Post by vrajx » Mon Dec 28, 2009 12:10 pm

Hey Nagesh,

what Dick said is correct. you have two ways.

1) Either you could do X ALL; C ALL '##' '$$'; C ALL PRG ARG
The above command will hide all the lines of the code and does two changes a) change ## to $$ where it encounters and b) change PRG from ARG
--- Once all the changes are done you can do RES command to view the entire code

2) Another way...... use &C PRG ARG and press enter
now this command will search and replace the first encountered string.
Then u can control the search and replace command with f5 and f6 buttons.
F5- Search next string
F6- replace string

I hope this is helpful to you.
Regards,
Raj.
vrajx

nagesh divvela
Member
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Post by nagesh divvela » Mon Dec 28, 2009 1:32 pm

Thanks all for the information..

@Dick, thanks for giving that suggestion, earlier I was trying with
X ALL <string1>; C ALL <string1> <string2>
which executed as it has to execute.

@Vraix, thanks for mentioning the command clearly, your reply has given me a clear idea, thats really helpful

Regards

User avatar
vrajx
Member
Posts: 3
Joined: Thu Dec 24, 2009 2:51 pm

Post by vrajx » Mon Dec 28, 2009 4:05 pm

anytime... :)
Regards,
Raj.
vrajx

nagesh divvela
Member
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Post by nagesh divvela » Wed Jan 13, 2010 2:02 pm

Hi,

I have gone through F1 as suggested, got the right answer for this.

after giving the Change command if we give 'L CHG', it will take you to the line where it was changed, '&L CHG' will take us through all the changed lines by enter.

Nagesh D

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