Page 1 of 1

Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 12:32 am
by Viswanathchandru
Dear all,

I was trying this piece of code(below) and I was not able to delete the particular lines as expected. And one more thing is even though I have coded "ISREDIT SAVE" "ISREDIT END" I need to press f3 for the file to get saved. Can anyone one suggest me where do I go wrong. Apologize if my thoughts are wrong.


/* REXX */                                 
"ISPEXEC EDIT DATASET('Z114VCT.DUMMY')"     
ADDRESS TSO                                 
"ISREDIT DELETE 1 10"                               
"ISREDIT SAVE"                             
"ISREDIT END"                               



Regards,
Viswa

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 1:11 am
by NicC
For a start you have not defined it as a macro. There is no macro statement.

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 1:38 am
by Viswanathchandru
Hi NicC,

Thanks for your time!

And that didn't wort even after adding "ADDRESS ISPEXEC"
"ISREDIT MACRO"


Please advice

Regards,
Viswa

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 1:52 am
by Peter_Mann
The correct way to call ISPEXEC MACRO services are
/* REXX */                                 
"ISPEXEC EDIT DATASET('Z114VCT.DUMMY') MACRO(dellines)"     
EXIT CODE(&LASTCC)
 

then your MACO (dellines) for example can consist of
ISREDIT MACRO
ISREDIT DELETE 1 10                               
ISREDIT SAVE                             
ISREDIT END 


I have not testing the code for syntax but the basics are there.

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 2:01 am
by Viswanathchandru
Thanks a ton Peter...

Regards,
Viswa

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 2:02 am
by enrico-sorichetti
here
tso-ispf/topic8602.html#p41498
You thanked for the link I posted for a working snippet

but looks like You did not care to look at it
if You had You would not have started this topic :mrgreen:

Re: Delete lines using ISREDIT - Help needed.

PostPosted: Fri Jan 04, 2013 2:12 am
by Pedro
Think of ""ISPEXEC EDIT ... " as an external subroutine. When a rexx program calls an external subroutine, the rexx program is suspended until the subroutine ends. Only when the subroutine ends does the next rexx statement get executed. And that is why your initial program could not work.