View previous topic :: View next topic |
Author |
Message |
binoy Beginner
Joined: 03 Oct 2003 Posts: 17 Topics: 7
|
Posted: Thu Jan 08, 2004 2:22 am Post subject: Rexx code help |
|
|
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 |
|
 |
taltyman JCL Forum Moderator

Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Thu Jan 08, 2004 9:55 am Post subject: |
|
|
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 |
|
 |
|
|