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

calrification needed about ISREDIT command.


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

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Sun Jun 07, 2009 1:00 pm
Reply with quote

Hi all,

i have written a ISREDIT Macro which will strip all the unwanted blanks in the PS or PDS member and will realign the file content without any blanks and write back the realigned content continuously till column 72.

As i used ISREDIT Macro, even if i open my file in View mode, the macro is getting executed and the contents are saved. i didn't issue any save command explicitly.

My requirement is if the user opens the file in view mode, the contents should not be saved.

Kindly help me out in this issue.

Thanks in advance.
Suma
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Jun 07, 2009 2:10 pm
Reply with quote

At the start of your macro, use the SESSION command to determine whether you are in EDIT or VIEW mode.

O.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Jun 07, 2009 5:28 pm
Reply with quote

Quote:
As i used ISREDIT Macro, even if i open my file in View mode, the macro is getting executed and the contents are saved. i didn't issue any save command explicitly.


there is a lot of BS in the above quote.

if you are in VIEW mode, the SAVE command is not available.

The only way you can change the dataset/member while in VIEW mode is REPLACE.
or
your macro invokes an EDIT session
or
you using an EXCIO to read/write the dataset/member
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jun 08, 2009 1:55 am
Reply with quote

suma_infy wrote:
As i used ISREDIT Macro, even if i open my file in View mode, the macro is getting executed and the contents are saved.
What do you mean by "is getting executed"? Automatically?
Can we see the macro code? This is the best way to get your problem fixed...
Back to top
View user's profile Send private message
suma_infy

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Mon Jun 08, 2009 8:48 am
Reply with quote

yes i'm using an EXECIO to write to the dataset/member....

i don't have my macro code at present...

Macro logic flows like this...
i) Read the content of the file and store the data in a stem variable.
ii) Strip unwanted blanks from each and every line and store the content continuously in a single variable.
iii) Parse the data till column 72 and store in another output stem variable.
iv) Write the output stem variable content in the same data set.

My requirement is even if the file is opened in view mode, i should display the re-aligned content to the user but when the user press F3, the realigned content should not be saved if opend in view mode.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jun 08, 2009 9:01 am
Reply with quote

I suggest macro logic flows like this...
i) Read the content of the file and store the data in a stem variable.
ii) Strip unwanted blanks from each and every line and store the content continuously in a single variable.
If session_type = 'EDIT' Then
do
iii) Parse the data till column 72 and store in another output stem variable.
iv) Write the output stem variable content in the same data set.
end

See Ofer's suggestion about the SESSION macro instruction.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jun 08, 2009 9:07 am
Reply with quote

On further thought, you should also worry about the EDIT user issuing the CANCEL command.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Mon Jun 08, 2009 1:15 pm
Reply with quote

Why are you doing your own writes? That doesn't make any sense.
Either change the data in the edit session and let the editor write it (and view will not write it) or don't use an edit macro. There should never be a reason to do EXECIO on the same file you are editing.
Back to top
View user's profile Send private message
suma_infy

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Mon Jun 08, 2009 6:12 pm
Reply with quote

It will be very helpfull if any one can post a sample code which relates to this scenario(Read file - edit file - write in the same file)

Many Thanks
Suma
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Mon Jun 08, 2009 6:43 pm
Reply with quote

suma_infy wrote:
It will be very helpfull if any one can post a sample code which relates to this scenario(Read file - edit file - write in the same file)
Many Thanks
Suma

There are many examples on the forum, for I have posted two or three alone, and many more contributors have too.

Have you searched the forum or read the ISPF edit macro book which can be easily reached from the sticky - reference materials - in the REXX / TSO forum ?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jun 08, 2009 10:33 pm
Reply with quote

Quote:
i have written a ISREDIT Macro which will strip all the unwanted blanks in the PS or PDS member and will realign the file content without any blanks and write back the realigned content continuously till column 72.

It seems like you already have what you need, just do not do the execio. The user will see your changes and when done, the editor will save the data.
Back to top
View user's profile Send private message
suma_infy

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Sat Jun 13, 2009 7:59 pm
Reply with quote

Many thanks for all your suggestions...

i'm able to run my macro successfully...

once again thank u all...
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 REXX/CMS How to place command console... CLIST & REXX 4
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts How to Login in to cics region and is... CICS 9
No new posts Passing containers on START command CICS 4
Search our Forums:

Back to Top