On Tue, Aug 15, 2017 at 12:32 AM, venkat kulkarni <
[email protected]> wrote:

> Hello,
>
>  I have requirement to run omvs command using batch job but not sure, where
> i am making mistake.
>
> //IBMUSEER JOB 654,VENKAT,CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
> //STEP1  EXEC PGM=IKJEFT01
> //SYSTSPRT DD SYSOUT=*
> //SYSPRINT DD SYSPUT=*
> //SYSTSIN DD *
>
>          OGET '/u/venkat/test_01.txt'   'IBM06.DATA.TEST1'
>           OGET '/u/venkat/test_02.txt'   'IBM06.DATA.TEST2'
>
>
> ​​
> OSHELL
>                {
>       echo '!rm -r /u/venkat/test_01.txt' ; +
> ​​
>       echo '!rm -r /u/venkat/test_01.txt'   ; }
>
> /*
>
> but this jcl doesn't seems to be removing the file from the location,we
> mentioned but OGET command works well.
>
> Please suggest, if any changes in this JCL is required to make this full
> process work.
>
>
​Well, first off, the OSHELL has the wrong syntax as show in the above
message. It should look like:

​
OSHELL +
     { +
       echo '!rm -r /u/venkat/test_01.txt' ; +
    ​
​
   echo '!rm -r /u/venkat/test_01.txt'   ; }

​Second, why do you expect an "echo" command to remove files? You have
simply said to "echo" the "!rm ..." lines to stdout. Which is what happened
in my test. The ! in the string does NOT mean "execute the following
string". You should have something like:

OSHELL +
     { +
       rm -r /u/venkat/test_01.txt ; +
    ​
​
   rm -r /u/venkat/test_01.txt   ; }
​
​or, even simpler:

OSHELL +
       rm -r /u/venkat/test_01.txt ; +
    ​
​
   rm -r /u/venkat/test_01.txt   ;


​Lastly, why are you doing two "rm" commands for the same file?​


-- 
If you look around the poker table & don't see an obvious sucker, it's you.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to