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

how to comment out jcl like statements


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Viswaraj senthil

New User


Joined: 19 Jul 2011
Posts: 3
Location: CHENNAI

PostPosted: Tue Jul 19, 2011 10:52 am
Reply with quote

Hi,

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.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 10:58 am
Reply with quote

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.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 19, 2011 11:02 am
Reply with quote

why not create a member in you pds called work,
which contains 1 line consisting of //*.
then just copy where you want.

you say you want to insert comments,
and you say you want to have 'marked' (what ever that means) lines commented out.

do you want to do two things or 1?

also, don't post the same question in two forums simultaneously.

your bad manners are only exceeded by your inability to express yourself.
Back to top
View user's profile Send private message
Viswaraj senthil

New User


Joined: 19 Jul 2011
Posts: 3
Location: CHENNAI

PostPosted: Tue Jul 19, 2011 11:59 am
Reply with quote

Hi,

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.

Code:

****** ***************************** Top of Data ******************************
000001 //JOBNAME JOB  12345ABC, , COMMENT JOB
000002 //            CLASS=A,MSGCLASS=K,REGION=8000K,COND=(0,NE)     
000003 //*                                                           
000004 //JOBLIB       DD  DSN=USID.PGM.OBJLIB,                     
000005 //            DISP=SHR                                         
000006 //             DD  DSN=USID.PGM1.LOADLIB,                       
000007 //            DISP=SHR                                         
000008 //             DD  DSN=SYS2.COBLIB,                           
000009 //            DISP=SHR                                         
000010 //             DD  DSN=SYS3.COBOLVS2.COB2LIB,                 
00CM11 //            DISP=SHR                                         
000012 //             DD  DSN=SYS2.SUBRLIB,                           
000013 //            DISP=SHR                                         
000014 //             DD  DSN=SYS3.ABNDIDMS.LOAD,                     
000015 //            DISP=SHR                                         

         ----------- NEXT PAGE ---------------------
000016 //             DD  DSN=USID.PGM2.LOAD,                   
000017 //            DISP=SHR                                         
000018 //             DD  DSN=USID.PGM3.LOAD,       
000019 //            DISP=SHR                           
000020 //             DD  DSN=USID.PGM4.LOAD,             
000021 //            DISP=SHR                           
000022 //STEP1   EXEC PGM=IEFBR14,                     
000023 //            COND=(0,NE)                         
000024 //*                                               
000025 //STP01A      DD  DSN=USID.SYS.FILE1,     
000026 //            DISP=(NEW,CATLG,DELETE),           
000027 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
00CM28 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000029 //*                                               
000030 //STP02A      DD  DSN=USID.SYS.FILE2,     
000031 //            DISP=(NEW,CATLG,DELETE),   
       
         ----------- NEXT PAGE ---------------------
000032 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000033 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000034 //*                                               
000035 //STP03A      DD  DSN=USID.SYS.FILE3,     
000036 //            DISP=(NEW,CATLG,DELETE),           
000037 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000038 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000039 //*                                               
000040 //STP04A      DD  DSN=USID.SYS.FILE4,     
000041 //            DISP=(NEW,CATLG,DELETE),           
000042 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000043 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000044 //*                                               
****** **************************** Bottom of Data ****************************


If I marked in line command with ‘CM’ from line no 11 to 28, I would like to get commented out those lines after hitting enter like below.
Code:

****** ***************************** Top of Data ******************************
000001 //JOBNAME JOB  12345ABC, , COMMENT JOB
000002 //            CLASS=A,MSGCLASS=K,REGION=8000K,COND=(0,NE)     
000003 //*                                                           
000004 //JOBLIB       DD  DSN=USID.PGM.OBJLIB,                     
000005 //            DISP=SHR                                         
000006 //             DD  DSN=USID.PGM1.LOADLIB,                       
000007 //            DISP=SHR                                         
000008 //             DD  DSN=SYS2.COBLIB,                           
000009 //            DISP=SHR                                         
000010 //             DD  DSN=SYS3.COBOLVS2.COB2LIB,                 
000011 //*//            DISP=SHR                                         
000012 //*//             DD  DSN=SYS2.SUBRLIB,                           
000013 //*//            DISP=SHR                                         
000014 //*//             DD  DSN=SYS3.ABNDIDMS.LOAD,                     
000015 //*//            DISP=SHR                                         

         ----------- NEXT PAGE ---------------------
000016 //*//             DD  DSN=USID.PGM2.LOAD,                   
000017 //*//            DISP=SHR                                         
000018 //*//             DD  DSN=USID.PGM3.LOAD,       
000019 //*//            DISP=SHR                           
000020 //*//             DD  DSN=USID.PGM4.LOAD,             
000021 //*//            DISP=SHR                           
000022 //*//STEP1   EXEC PGM=IEFBR14,                     
000023 //*//            COND=(0,NE)                         
000024 //*//*                                               
000025 //*//STP01A      DD  DSN=USID.SYS.FILE1,     
000026 //*//            DISP=(NEW,CATLG,DELETE),           
000027 //*//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000028 //*//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000029 //*                                               
000030 //STP02A      DD  DSN=USID.SYS.FILE2,     
000031 //            DISP=(NEW,CATLG,DELETE),   
       
         ----------- NEXT PAGE ---------------------
000032 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000033 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000034 //*                                               
000035 //STP03A      DD  DSN=USID.SYS.FILE3,     
000036 //            DISP=(NEW,CATLG,DELETE),           
000037 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000038 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000039 //*                                               
000040 //STP04A      DD  DSN=USID.SYS.FILE4,     
000041 //            DISP=(NEW,CATLG,DELETE),           
000042 //            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE), 
000043 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)   
000044 //*                                               
****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 19, 2011 12:10 pm
Reply with quote

I would suggest:

labeling line 11 with .a and line 28 with .b

then command line:

Code:
chg all .a .b '//' '//*//' 1


even:
command line
Code:
keys


i used PF1 for this example:
Code:

                                Keylist Utility
    File

  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.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Tue Jul 19, 2011 12:21 pm
Reply with quote

why not use a sequence of simple ISPF editing commands ???

move the cursor to the first line to be commented and type .a in the label/number area

move the cursor to the last line to be commented and type .b in the label/number area,

in the command line type c '//' '//*//' .a .b 1 all

easy, effective no edit macro issues
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Tue Jul 19, 2011 12:28 pm
Reply with quote

heck Dick! You beat me icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jul 19, 2011 12:31 pm
Reply with quote

I have posted this before, but as the SEARCH doesn't appear to be working too well at the moment
Code:
"ISREDIT MACRO NOPROCESS"
"ISPEXEC CONTROL ERRORS RETURN"
"ISREDIT PROCESS RANGE N"
"ISREDIT (FRL) = "LINENUM .ZFRANGE
"ISREDIT (TOL) = "LINENUM .ZLRANGE
"ISREDIT LABEL "FRL" = .A"
"ISREDIT LABEL "TOL" = .B"
"ISREDIT C '//' '//*~' 1 ALL .A .B "
"ISREDIT RESET LABEL"
EXIT (1)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Tue Jul 19, 2011 12:37 pm
Reply with quote

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
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 12:41 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 12:48 pm
Reply with quote

And you beat me, enrico...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jul 19, 2011 12:51 pm
Reply with quote

I do have a preferred method of using IF/THEN/ELSE processing which removes the need for shifting and overlay, also a macro.
Back to top
View user's profile Send private message
Viswaraj senthil

New User


Joined: 19 Jul 2011
Posts: 3
Location: CHENNAI

PostPosted: Tue Jul 19, 2011 12:59 pm
Reply with quote

Thanks a lot .... dbzTHEdinosauer
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Repeat a DD line- comment and insert ... CA Products 3
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts Embeding DB2 sql statements in scirpt... DB2 7
Search our Forums:

Back to Top