I want to insert comments (//*) in JCL by moving the lines using REXX or CLIST. If i will give Line Command like 'CM' and when i will enter the marked lines will need to be comment out. Please help me the code for this.
Joined: 23 Nov 2006 Posts: 19254 Location: Inside the Matrix
Hello and welcome to the forum,
First - if you want to be successful using the forum, you need to create a subject that describes briefly what you want to learn or are having problems doing. A subject of "Need Help" is just a complete waste of everyone's time.
When looking for help, it is expected that you tell us what you have tried so far and what problems you have encountered.
I apologies for described such type of topic name. And I agree that this post was asked in other forum site which is posted by one of my friend. Actually we both are seeking help for the same problem. I am giving you again my requirement with example and please help me with CLIST or REXX code.
Joined: 20 Oct 2006 Posts: 6970 Location: porcelain throne
I would suggest:
labeling line 11 with .a and line 28 with .b
then command line:
chg all .a .b '//' '//*//' 1
i used PF1 for this example:
QFOS#1 ISR Keylist ISRSPEC Change Row 1 to 12 of 24
Command ===> Scroll ===> PAGE
Make changes and then select File action bar.
Keylist Help Panel Name . . . ISRSPECH
Key Definition Format Label
F1 . . . chg all .a .b '//' '//*//' 1 SHORT Help
F2 . . . SPLIT LONG Split
F3 . . . EXIT SHORT Exit
F4 . . . :TS LONG :TS
F5 . . . RFIND SHORT Rfind
F6 . . . RCHANGE SHORT Rchange
F7 . . . UP LONG Up
F8 . . . DOWN LONG Down
F9 . . . SWAP LONG Swap
F10 . . LEFT LONG Left
F11 . . RIGHT LONG Right
F12 . . RETRIEVE SHORT Retrieve
then all you would have to do is put .a on line 11, .b on line 28 and PF1.
let' s move to the philosophical side of things,
in general when commenting jcl streams I prefer to shift everything 4 chars to the right
and overlay the first 4 char with //*> in order o preserve also the layout of <data> statements
so to uncomment a shift left ((4 would be enough
naturally with the hope that each statement jcl/data does not extent after column 68
Joined: 09 Mar 2011 Posts: 7312 Location: Inside the Matrix
Gosh, I always thought there had to be a blank after //*
How about including the column boundaries for the change?
What I'd also consider is shift right 4, for you block of lines. Then copy a comment line overlaying the block.
These ways, you'd definitely only get first // on line. Else, sometime, you might hit a comment with // in it. Which gets you into a macro again.
To get rid of the comments again, a destructive left shift is an option to the change to nothing.
Learn the editor (I'm a bit out of date, which is why I'm being a bit general, plus you get a bit of learning finding out what I mean). There is much you can do with it without having to write something specific.
One little hint extra. Unless you are a top-line thinker, don't assign an edit string to a key you already use for something else.