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: 10773
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 Embeding DB2 sql statements in scirpt... DB2 7
No new posts Alter User LOGON Script Parameters CLIST & REXX 11
No new posts REXX script to beautify XML CLIST & REXX 1
No new posts FSET not working on my receive CICS 3
No new posts Mainframe jcl job with href links not... All Other Mainframe Topics 3
Search our Forums:

Back to Top