Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

calrification needed about ISREDIT command.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: calrification needed about ISREDIT command.
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: 2360
Location: Israel

PostPosted: Sun Jun 07, 2009 2:10 pm    Post subject:
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    Post subject:
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: 1226
Location: Israel

PostPosted: Mon Jun 08, 2009 1:55 am    Post subject: Re: calrification needed about ISREDIT command.
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    Post subject: Reply to: calrification needed about ISREDIT command.
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

Senior Member


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

PostPosted: Mon Jun 08, 2009 9:01 am    Post subject: Reply to: calrification needed about ISREDIT command.
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

Senior Member


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

PostPosted: Mon Jun 08, 2009 9:07 am    Post subject: Reply to: calrification needed about ISREDIT command.
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: 401
Location: Mumbai

PostPosted: Mon Jun 08, 2009 1:15 pm    Post subject: Reply to: calrification needed about ISREDIT command.
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    Post subject: Reply to: calrification needed about ISREDIT command.
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 08, 2009 6:43 pm    Post subject: Re: Reply to: calrification needed about ISREDIT command.
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

Senior Member


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

PostPosted: Mon Jun 08, 2009 10:33 pm    Post subject: Reply to: calrification needed about ISREDIT command.
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    Post subject: Reply to: calrification needed about ISREDIT command.
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us