Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Edit large number of datasets (QSAM)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 113
Location: UK

PostPosted: Tue Apr 04, 2017 6:08 pm    Post subject: Edit large number of datasets (QSAM)
Reply with quote

I need to edit date on header of all the files which have same format and attributes. I have the list of datasets to edit.

How can I do it in batch or using marco? I am using RUMBA if that helps. Thanks.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2126
Location: UK

PostPosted: Tue Apr 04, 2017 8:17 pm    Post subject:
Reply with quote

Create an edit macro that will do the change and end the edit session
Move your list to the mainframe (if it is not already there)

Rexx:-
read a data set name from your list
Invoke edit with a macro
Read next name
Repeat until done.

Test first with one or two data sets (backed up first).

Examples exist on the forum.
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 113
Location: UK

PostPosted: Thu Apr 06, 2017 7:47 pm    Post subject:
Reply with quote

Thanks for your reply. I have not done any Rexx in past but I am quite keen to learn. Can you please point me to the thread where a similar macro is discussed. Thanks.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2126
Location: UK

PostPosted: Fri Apr 07, 2017 4:21 pm    Post subject:
Reply with quote

The macro is simple - here is an example:
Code:
/*--------------------------------------------------------------------*/
/* Edit Macro: forum.SPF                                              */
/* Function: Apply a CHANGE command and then EXIT the data set/member */
/*           being edited                                             */
/*--------------------------------------------------------------------*/
"ISREDIT macro"
"ISREDIT change 'abc' 'xyz' all"
"ISREDIT end"
Exit


The rexx is also simple:
Code:
/*- Rexx ------------------------------------------------------------*/
/*                                                                   */
/*  Sample program to read a list of data sets from a data set and   */
/*  then edit each dataset using a macro.                            */
/*                                                                   */
/*  This is written assuming that the program is to be run in batch  */
/*  with the input data set allocated in the JCL to ddname THELIST.  */
/*                                                                   */
/*  Being run in batch the appropriate ISPF libraries must be        */
/*  allocated in the JCL.                                            */
/*                                                                   */
/*  No error checking has been incorporated into this sample code.   */
/*                                                                   */
/*  Written by: Rexxcellent Software   Date: April 2017              */
/*                                                                   */
/*------------------------------------------------------------ Rexx -*/
Trace N
/* Read the list of data sets into stem dsn_list. */
EXECIO * DISKR thelist(stem dsn_list. finis)
/* dsn_list.0 has the count of lines read */

/* Now process the list one-by-one */
Do i = 1 to dsn_list.0

   Address ISPEXEC "edit "dsn_list.i" IMACRO(macroname)"
/*----------
You may need to quote the data set name in the above line...
Addre... "edit '"dsn_list.1"' IMAC...
----------*/

End

Exit


Note: these are examples only but the macro has been tested. The more difficult part may be the JCL! There is a recent example of the requirement in the Beginner's Forum.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to count the number of times key ... vnktrrd DFSORT/ICETOOL 14 Thu Nov 15, 2018 9:19 pm
No new posts Accessing control blocks to retrieve ... menonkiran COBOL Programming 5 Wed Nov 14, 2018 9:08 pm
No new posts Get line number where cursor is from ... satish.ms10 CLIST & REXX 3 Wed Oct 24, 2018 12:23 am
No new posts DUMP A Multi volume datasets and rest... lind sh JCL & VSAM 6 Mon Oct 01, 2018 12:02 pm
No new posts ISPF 3.4 edit of a ps file, disp use... Carrie Da Silva TSO/ISPF 3 Fri Sep 21, 2018 3:01 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us