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 

Rexx code help

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


Joined: 03 Oct 2003
Posts: 17
Topics: 7

PostPosted: Thu Jan 08, 2004 2:22 am    Post subject: Rexx code help Reply with quote

Hi,
I have a requirement as stated below:

I have to write a Rexx Macro that will help me edit a dataset.
The dataset will contain some data as below

----.----1----.----2----.----3----.----4----.----5-

****************************************************
0 B T S 3270 FORMATTED SCREEN IMAGE. MID/MOD= G

*01* SIGNOFF
3C- 30 3C
*02*

*03* SIGNOFF HAS COMPLETED SUCESSFULLY
****************************************************

Here i have to edit the dataset to keep only the blocks from *01*
to *02* with all the lines in between .

eg :
----.----1----.----2----.----3----.----4----.----5-

****************************************************
*01* SIGNOFF
3C- 30 3C
*02*
****************************************************

I feel this can be achieved by 2 ways : 1
by placing a label (a) on line on which we find *01*
similarly placing a label (b) on line on which we find *02*
and then xclude those line in the dataset keep doing this till end of
dataset.

or 2nd way is :

by placing a character "a" on column 1 of the line on which we find
*01*
similarly
by placing a character "b" on column 1 of the line on which we find
*02*
and then xclude those line in the dataset keep doing this till end of
dataset.

Could some on help me with the REXX code for the same.
and also if we could get the line number of the line on which we find
*01* we can use it for some processing.

Thanks & Regards,
Brij
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Thu Jan 08, 2004 9:55 am    Post subject: Reply with quote

This should at least get you going...

Code:

/**************REXX****************/                   
ADDRESS ISPEXEC                                       
"ISREDIT MACRO (PARM1) NOPROCESS"                     
"ISREDIT RESET"                                       
"ISREDIT LOCATE .ZFIRST"                               
"ISREDIT FIND '*01*' NEXT"                             
"ISREDIT (LINER) = LINENUM .ZCSR"                     
liner = liner - 1                                     
"ISREDIT DEL .zfirst" liner                           
rc = 0                                                 
do until rc > 0                                       
  "ISREDIT FIND '*02*' NEXT"                           
  "ISREDIT (LINER) = LINENUM .ZCSR"                   
  liner = liner + 1                                   
  "ISREDIT LABEL "LINER" = .BB 0"                     
  "ISREDIT FIND '*01*' NEXT"                           
  if rc > 0 then iterate                               
  "ISREDIT (LINER) = LINENUM .ZCSR"                   
  liner = liner - 1                                   
  "ISREDIT LABEL "LINER" = .AA 0"                     
  "ISREDIT DEL .BB .AA"                               
  "ISREDIT RESET "                                     
end                                                   
"ISREDIT DEL .BB .zlast"     
"ISREDIT RESET "             
"ISREDIT CURSOR = .ZFIRST"   
RETURN                       
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