Page 2 of 2

Re: SAVE in VIEW mode

PostPosted: Sat Dec 10, 2011 11:15 pm
by NicC
Did you try running the REPL as a straight command on the command line - you would get the answer then.
Also - you are in a PDS so why check for PO organisation?

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 12:17 am
by John12
Before coding the rexx code i tried the REPL .zf .zl command from tso command line in mainframe it is working fine as expected .But my project requirement is to run this code thru rexx program.when I will enter Enter the command ‘BKUP’ in command line and press Enter it will take the backup of the member and save it in PDS with the name of PDSname.BACKUP. If the backup PDS does not exist please create the backup PDS and then copy the member.But I am not able to do the code and also not able to find the error in my code.Would you be able to help me in guiding.I am using IF SYSDSORG = "PO" to check whether the dataset is PDS or not.

/*REXX*/
"ISREDIT MACRO "
"ISPEXEC CONTROL ERRORS RETURN"
X = MSG("OFF")
"ISREDIT (PDSNAME) = DATASET"
"ISREDIT (MEMNAME) = MEMBER"
VPDS = "'"PDSNAME"("MEMNAME")'"
Y = LISTDSI("'"PDSNAME"'")
IF SYSDSORG = "PO" THEN
DO
"ISREDIT REPL .ZF .ZL " MEMNAME
IF RC = 0 THEN
ZEDLMSG = MEMNAME 'SAVED!'
ELSE
ZEDLMSG = MEMNAME ' NOT SAVED!'
"ISPEXEC SETMSG MSG(ISRZ001)"
END
dsname = "'xxx.REXX(BKUP)'"
ddname = "SYSPROC"
"ISPEXEC QBASELIB "ddname" ID(dslist)"
"ALLOC F("ddname") DA("dsname","dslist") SHR REU"
Exit 0

Thanks,

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 3:54 am
by prino
Holy crap, the whole fecking raison d'être for View is to look at data and not to modify it, or to modify it with the certainty that it cannot accidentally be saved in its modified state.

You are basically wasting our time with a requirement to make it possible to use View as Edit, may I suggest that you use Edit for this purpose in the future?

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 6:31 am
by dick scherrer
Hello John,

This forum (unlike many others on the web) is here to help you learn - NOT actually do the work. As you work thru getting what you want, people here will help. Often thru several iterations.

Something to be aware of is that you need to make sure that what you believe you want is practical. Why do you believe you want View to perform as Edit?

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 11:37 am
by NicC
Well, when I tried the command on the command line I got amessage saying I was unable to replace the member because it was in use i.e. I was viewing it. You can create a new member or replace the member, if it exists, in another PDS but you cannot replace the one you are actually viewing.

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 2:33 pm
by prino
NicC wrote:Well, when I tried the command on the command line I got amessage saying I was unable to replace the member because it was in use i.e. I was viewing it. You can create a new member or replace the member, if it exists, in another PDS but you cannot replace the one you are actually viewing.

Oh yes, you can! View doesn't take any enqueues and a "repl .zf .zl mem" where "mem" is the member currently being viewed will work. Not bothered to try the OP's stuff, but it's obvious that something else must be wrong!

Re: SAVE in VIEW mode

PostPosted: Sun Dec 11, 2011 9:45 pm
by NicC
Prino - I tried it before posting and that was the message I got. I'll try again though just to double check.

Just done that and it worked ok - something must have fouled up yesterday whilst I was trying it out. I am pretty certain that I WAS in view mode at the time.