MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I perform file handling inside an edit macro?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
arindam
Beginner


Joined: 08 Jan 2003
Posts: 5
Topics: 1
Location: India, Kolkata

PostPosted: Wed Jan 15, 2003 7:12 am    Post subject: How can I perform file handling inside an edit macro? Reply with quote

My requirement is to put some message line at the top of a file when opened in EDIT mode. But, the message is decided at the run time and will come from another file. Now I am facing the problem while accessing the second file (containing message text) inside the MACRO, as EXECIO is not permitted inside the MACRO. Can anybody provide any solution regading this?
Shocked

Thanks in advance.
_________________
Thanks and Regards,
Arindam
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Wed Jan 15, 2003 7:44 am    Post subject: Reply with quote

You can read the file in the driver REXX routine and write it to a stem variable or a stack and then use it in the edit macro.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
arindam
Beginner


Joined: 08 Jan 2003
Posts: 5
Topics: 1
Location: India, Kolkata

PostPosted: Wed Jan 15, 2003 7:53 am    Post subject: Reply with quote

Thanks for the input Manas. But I have already tried with the stem variable. What I did, I read the file before calling the macro. Now, you need to pass the data stored in the stem variable to the macro. How can you do that? One solution is put them into profile (using VPUT) and get them inside the macro (using VGET). But, the VPUT/VGET command doesn't work with compound variables and even you dont know how many lines you have to insert as the note.

I am not sure about STACK option. I have to check it out.

Anyway, thanks for your co-operation.
_________________
Thanks and Regards,
Arindam
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Wed Jan 15, 2003 8:06 am    Post subject: Reply with quote

I've never had a problem reading a file with EXECIO in an edit macro. Why don't you post your code or the error message you are gettting...
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
arindam
Beginner


Joined: 08 Jan 2003
Posts: 5
Topics: 1
Location: India, Kolkata

PostPosted: Wed Jan 15, 2003 8:16 am    Post subject: Reply with quote

In fact I was amused too. It was a silly thing that was missing in my macro. Before "ADDRESS ISREDIT" I had to include "ADDRESS TSO" for the EXECIO operation. Grrrrrrrr.
_________________
Thanks and Regards,
Arindam
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Wed Jan 15, 2003 6:24 pm    Post subject: Reply with quote

Arindam,
the following is code that could be used to place STEM variables into ISPF variables. Where n is an arbritary number an IN.n is the populated STEM variable then.

Code:

LCNT = n
VPUTVARS = "LCNT "
Do i = 1 to n
  VNAME = "L"||Right(i,8,'0')
  Interpret VNAME" = "IN.i
  VPUTVARS = VPUTVARS||VNAME||" "
End
"VPUT ("VPUTVARS "VPUTVARS) SHARED"


Say n = 3 then you will have stem variables IN.1, IN.2 & IN.3
The above code will generate variables L0000001, L0000002 & L0000003 (with values as per IN.1, IN.2 & IN.3 respectively)

the variable VPUTVARS will end up with the value
LCNT L0000001 L0000002 L0000003
i.e. the list of variable names (including the number of stem variables, as held in LNCT)

The last line, that does the VPUT will equate to :-
VPUT (LCNT L0000001 L0000002 L0000003 VPUTVARS) SHARED

(putting VPUTVARS, the list of variables put into the pool simplefies the VGETS when retrieving the variables e.g.
"VGET(VPUTVARS) SHARED"
"VGET("VPUTVARS") SHARED"

Using LCNT you could rebuild the stem variables if required.

Note This obviously only works if the tail of the stem variable is a numeric, also there are restrictions on how many variables can be handled in this fashion.

Note I haven't actually checked the above code, just typed it in, so there's probably some stupid little errors.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group