MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parsing through a dataset content

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
JOHNCWL
Beginner


Joined: 25 Feb 2004
Posts: 31
Topics: 16

PostPosted: Wed Feb 25, 2004 8:56 am    Post subject: Parsing through a dataset content Reply with quote

Hi,
I want to parse through a file and change all the
SET CURRENT SQLID=
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Wed Feb 25, 2004 2:49 pm    Post subject: Reply with quote

You can use Edit-Macro. Here is some example:
Code:
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"

STRING1 = "SQLID=?XXXXXXX?"
STRING2 = "SQLID=?XXXYYY?"
STRING3 = "SQLID=?JOHN?"

ADDRESS ISREDIT "C ALL "STRING1 STRING3
ADDRESS ISREDIT "C ALL "STRING2 STRING3
ADDRESS ISREDIT "SAVE"

EXIT


O.
________
SDR 200


Last edited by ofer71 on Sat Feb 05, 2011 11:16 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JOHNCWL
Beginner


Joined: 25 Feb 2004
Posts: 31
Topics: 16

PostPosted: Thu Feb 26, 2004 5:31 am    Post subject: Reply with quote

HI,

Sorry I was not clear of the requirment. Now the requirement is as follows:

I ahve a dataset as:

SET CURRENT SQLID = 'XXXXXX';

CREATE DATABASE ...........

COMMIT;

SET CURRENT SQLID = 'XXXYYY';

CREATE TABLESPACE .............

COMMIT;

So there are my lines in between SIMILAR to SET CURRENT SQLID.

First I want to delete this all SET CURRENT SQLID through out the file and then put a SET CURRENT SQLID only at the top, i.e first line.

So how to write the macro for this and also is I need to call this macro on a dataset(JOHN.DDLs) how to invoke it??


Pls help me... Rolling Eyes
Back to top
View user's profile Send private message
JOHNCWL
Beginner


Joined: 25 Feb 2004
Posts: 31
Topics: 16

PostPosted: Thu Feb 26, 2004 5:38 am    Post subject: Reply with quote

SET CURRENT SQLID = '???????' is not fixed length, Max is 8 characters...
So irrespective of what it is .. i need to change it to JOHN only.
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Feb 26, 2004 5:50 am    Post subject: Reply with quote

Here is your solution, again - Edit-Macro:

Code:
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "X ALL 'SET CURRENT SQLID'"
ADDRESS ISREDIT "DELETE X ALL"
 
NEWLINE = "SET CURRENT SQLID='JOHN'"
ADDRESS ISREDIT "LINE_BEFORE 1 = (NEWLINE)"

ADDRESS ISREDIT "END"

EXIT


You can run this macro through all members of PDS using the following REXX:
Code:
/* REXX */                                                             

MAC  = 'CHGSQLID'                                                           
PDS  = "your.pds"                                         
                                                                       
                                                                       
X = OUTTRAP("LIBMEM.")                                                 
 ADDRESS TSO "LISTDS '"PDS"' M"                                           
X = OUTTRAP("OFF")                                                     
                                                                       
DO I = 7 TO LIBMEM.0                                                   
  LIBMEM.I = STRIP(LIBMEM.I)                                           
  ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")" 
END                                                                     
                                                                       
EXIT                                                                   
                                                                       


O.
________
Ford XR Falcon history


Last edited by ofer71 on Sat Feb 05, 2011 11:16 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JOHNCWL
Beginner


Joined: 25 Feb 2004
Posts: 31
Topics: 16

PostPosted: Thu Feb 26, 2004 9:03 am    Post subject: Reply with quote

Thanks !! it worked!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group