Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Commenting 1 line in large number of members with cobol code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
rskumar

New User


Joined: 21 Nov 2005
Posts: 35
Location: chennai

PostPosted: Sun Dec 06, 2009 10:32 am    Post subject: Commenting 1 line in large number of members with cobol code
Reply with quote

Hi - I am new to REXX and i got a requirement. I am not asking for code and i have searched the forum for assisting my requirement but couldnt find much relevance. Could any of you please let me know how i should approach this requirement.

I need to comment a line (only one line) in a large number of cobol programs that are in a PDS. Its a copybook definition line for eg., COPY ABCD and i need to comment that line in the cobol programs and replace with a new line COPY EFGH. I am not able to frame the approach itself. Can any of you help me please.

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

dick scherrer

Site Director


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

PostPosted: Sun Dec 06, 2009 11:29 am    Post subject:
Reply with quote

Hello,

Don't know if this would work for your situation, but you might be able to:
1. make a backup copy of the pds.
2. Change COPY ABCD to COPY EFGH.
3. Re-compile.

If the original code was needed, it would all be in the backup of the pds.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 06, 2009 1:02 pm    Post subject:
Reply with quote

Your SCM tools should do the job.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sun Dec 06, 2009 2:36 pm    Post subject:
Reply with quote

There are a lot of examples of getting member lists from a PDS on the forum. That is the start point - knowing the member names. There are also examples of ISPF edit macros on the forum to perform the changes that you require.

At the top of the CLIST / REXX forum is a sticky which access all of the TSO and ISPF manuals that you will need to help you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sun Dec 06, 2009 5:38 pm    Post subject:
Reply with quote

if you have file aid at your shop, suggest you look at the edit/update function, and you could easily (and quickly) implement Dick Scherrer's suggestion.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1017
Location: Oostende, Belgium

PostPosted: Sun Dec 06, 2009 10:29 pm    Post subject:
Reply with quote

Jay Moseley's PDSUPDTE, assuming the PDS is FB80.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sun Dec 06, 2009 10:46 pm    Post subject:
Reply with quote

I "believe" that the OP's request is for help in putting an asterisk in column 7 of the EXISTING COPY statement ( i.e. commenting out the line ), and ADDING an additional COPY statement with the new copy member name.

There are any number of methods to apply an EDIT MACRO against ALL members of a PDS. See This Site for an example of the REXX "driver" code.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Dec 07, 2009 12:00 am    Post subject:
Reply with quote

Hello,

Quote:
I "believe" that the OP's request is for help in putting an asterisk in column 7 of the EXISTING COPY statement ( i.e. commenting out the line ), and ADDING an additional COPY statement with the new copy member name.
Yes, that was the request. It may or may not be the requirement. . . As i mentioned initially:
Quote:
Don't know if this would work for your situation,
If this needs to be operational quickly, the simple solution gets there quickly.

If this is to learn more about coding rexx, by all means, take the time to learn icon_smile.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Dec 07, 2009 11:22 am    Post subject:
Reply with quote

Hi,

Quote:
I "believe" that the OP's request is for help in putting an asterisk in column 7 of the EXISTING COPY statement ( i.e. commenting out the line ), and ADDING an additional COPY statement with the new copy member name.


As Dick Brenholtz has already mentioned, you can easily do it with FILEAID if you have it.


Gerry
Back to top
View user's profile Send private message
valyk

Active User


Joined: 16 Apr 2008
Posts: 104
Location: South Carolina

PostPosted: Tue Dec 08, 2009 10:25 pm    Post subject:
Reply with quote

If you are looking for something in Rexx, try something like this:

To get the members of a PDS:

Code:

PDS = 'YOUR.DATASET.GOES.HERE'

ADRESS TSO
X=OUTTRAP(MEMBERS.)
"LISTDS '"||PDS||"' MEMBERS"
X=OUTTRAP(OFF)
DO I=7 TO MEMBERS.0
  MEMBER = SUBWORD(MEMBERS.I,1,1)

  /* Search for certain character strings */
  CALL LINE_SRCH
END I


Now search for your string:

Code:
LINE_SRCH:
  /* OPEN PDS MEMBER FROM THE MEMBER LIST */
  PDSMEM = "'"PDS"("MEMBER")'"

  ADDRESS TSO
  "ALLOC DATASET("PDSMEM") FILE(MEMIN) SHR"
  "EXECIO * DISKR MEMIN (FINIS STEM IN_MEM."
  "FREE FILE(MEMIN)"

  DO LINE = 1 TO IN_MEM.0 BY 1
    OUTPUT = IN_MEM.LINE
    IF POS('Your character string here',OUTPUT) > 0 THEN DO
      /* CALL CHANGE ROUTINE */
      CALL CHANGE_STR OUTPUT,'* COPY ABCD','COPY ABCD'
      OUTPUT = STRING
    END

    QUEUE OUTPUT
  END
RETURN



This is the change routine. Works awesome. I found this on this forum I think.

Code:
CHANGE_STR:
  STRING = ARG(1)
  NEW    = ARG(2)
  OLD    = ARG(3)
  LNEW   = LENGTH(NEW)
  LOLD   = LENGTH(OLD)
  X      = 1

  DO FOREVER
    IF POS(OLD,STRING,X) = 0 THEN
      RETURN STRING

    X = POS(OLD,STRING,X)
    STRING = INSERT(NEW,DELSTR(STRING,X,LOLD),X-1,LNEW)
    X = X +  LENGTH(NEW)
  END
RETURN



Now just write out the PDS member with your queued output. I'm not sure if this is the most efficient way, but it works well for me.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us