IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to insert Blank lines in ISREDIT macro using rexx...???


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Mon Feb 10, 2014 10:10 pm
Reply with quote

Hi,
How to insert blank lines using rexx ISREDIT....I want to insert some n number of blank lines before a line containing values...so i tried to find the cursor position of that line and tried inserting a blank line using LINE_BEFORE instruction but still i am not able to achieve what i need...here is my code below :
/*REXX*/
"ISREDIT MACRO"
TRACE (R)
TEMP="NEW,CATLG,DELETE"
I=1
"ISREDIT SEEK ALL '"TEMP"'"
"ISREDIT (COUNT) = SEEK_COUNTS"
COUNT1=COUNT
DO WHILE COUNT > 0
IF RC=0 THEN DO
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
"ISREDIT (LINE) = LINE " VAL1
INPUT.I = STRIP(LINE)
PARSE VALUE "'"INPUT.I"'" WITH PREC ','
OUT=POS('=',PREC)
RES=SUBSTR(PREC,OUT+1)
OUTPUT.I=RES
"ISREDIT FIND NEXT '"TEMP"'"
COUNT=COUNT-1
I=I+1
END
END
TEMP1=EXEC
"ISREDIT FIND FIRST '"TEMP1"'"
RES1=COUNT1+3
DO J=0 TO RES1 BY 1
"ISREDIT LINE_BEFORE .ZCSR = ' ' "
END
INS=" SET MAXCC=0"
"ISREDIT LINE_BEFORE .ZCSR = '"INS"' "
"ISREDIT (LINE1) = LINENUM .ZCSR"
LINE2=LINE1-1
"ISREDIT CURSOR = "LINE2" 1"
I=STRIP(COUNT1,'L','0')
DO WHILE COUNT1 > 0
OUT=' ' || DELETE ||' ' || OUTPUT.I
"ISREDIT LINE_BEFORE .ZCSR = '"OUT"' "
COUNT1=COUNT1-1
I=I-1
END
"ISREDIT END"


In the above code i am finding the first EXEC and i want to leave 5 lines before that EXEC line as that 5 lines will have description of that step...How do i move my cursor backward from the EXEC line to the top of the description line....??? so that before that line i will insert "/* " and before that SET MAXCC=0 using LINE_BEFORE instruction....and i will insert the delete steps using same line_before (using OUT variable i wrote a code for that)... also i want to add the 3 more lines like the IDCAMS step before the delete step how to write those three steps....can i use QUEUE here for writing a 3 lines together...If so how to write command for that i have tried QUEUE with DISKW but i dont know how to use that in ISREDIT MACRO....some one please help me with these two problem which i am facing...please give me the syntax help or atleast some idea of how can i achieve writing this...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Feb 10, 2014 10:23 pm
Reply with quote

search the forum with LINE_BEFORE and You will find a few snippets
( know because I posted them )

To save some of Your precious time here are a couple of links ( LINE_BEFORE)

www.ibmmainframes.com/viewtopic.php?t=55037&highlight=linebefore
www.ibmmainframes.com/viewtopic.php?t=40237&highlight=linebefore

up to You to search for the examples with LINE_AFTER

but remember ... things might get tricky because of the changes in the line numbers
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Feb 10, 2014 11:44 pm
Reply with quote

Quote:
can i use QUEUE here for writing a 3 lines together...If so how to write command for that i have tried QUEUE with DISKW but i dont know how to use that in ISREDIT MACRO....

You should not use EXECIO ... DISKW (implied by the use of QUEUE) at the same time that you are editing a PDS member.

Quote:
still i am not able to achieve what i need
That is a pretty vague problem description.

Quote:
How do i move my cursor backward from the EXEC line to the top of the description line....???

It would help if you provided an example of the original data, including the description line. Also, please provide an example of the desired result. You verbally describe it, but an example would be much clearer. Lacking an example, my first suggestion is to use "FIND 'abc' PREV".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top