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

OMVS Shell Script not working properly.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rodferrn

New User


Joined: 14 Jul 2020
Posts: 14
Location: Brazil

PostPosted: Sat Apr 10, 2021 6:25 am
Reply with quote

Hi Folks, I hope this is the right place to post this message, since I did not see any OMVS specific forums I think this might be the one.

So, I wonder if you can help me with a shell script that I am trying to create to run under OMVS, basically this script is supposed to ask for filesystem and vsam datasets and create the filesystem and mount the vsam in the given file system.

If I remove the while from my script it runs ok (going through all options) but what I am trying to accomplish is to create some sort of loop so the user can create and mount as many files it is needed.

Appreciate any suggestions or tips on what I might be doing wrong.
Thanks in advance as always !!

Code:

i='-1'                                                                 
while test $i -ne 0                                                   
do                                                                     
    echo Please insert the directory you want to create:               
    read ZFS_FILE                                                     
    su                                                                 
    mkdir -p $ZFS_FILE                                                 
    chmod -R 775 $ZFS_FILE                                             
    echo                                                               
    echo Filesystem $ZFS_FILE created!!                               
    echo                                                               
    echo Please insert the VSAM dataset file name:                     
    read VSAM_FILE                                                     
    mount -f $VSAM_FILE $ZFS_FILE                                     
    echo                                                               
    echo Vsam file $VSAM_FILE has been mounted on Filesystem $ZFS_FILE
    echo Type 0 to quit or enter to run another command               
echo Bye!                                                             
done                                                                   
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Sat Apr 10, 2021 12:13 pm
Reply with quote

googling with bash while example would have given
at least two pages of links with working examples

here anyway the link to the bash manual

www.gnu.org/software/bash/manual/
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts using EGREP in OMVS TSO/ISPF 9
No new posts ICETOOL with JOINKEY for Big record l... DFSORT/ICETOOL 12
No new posts JCL JOB Cancel/Purge Not Working JCL & VSAM 6
Search our Forums:

Back to Top