# Interactive: completion of MVS names (data sets, members, DD names). # Off z/OS the catalog is a stand-in (ZASH_TEST_CATALOG, see sys_posix.c) # that is turned into real CSI work areas, PDS directory blocks and TIOT # entries, so this drives the same decoding the z/OS build uses. command -v python3 >/dev/null 2>&1 || exit 77 { echo "X SYS1" echo "SYS1.MACLIB" echo "SYS1.MACLIB(GETMAIN)" echo "SYS1.MACLIB(FREEMAIN)" echo "SYS1.MACLIB(IEFJFCB)" echo "SYS1.MACROS.OLD" echo "SYS1.MODGEN" echo "SYS1.PARMLIB" echo "DD:SYSIN" echo "DD:SYSPRINT" echo "DD:STEPLIB" # enough entries to need several CSI calls (resume) and directory blocks i=1 while [ $i -le 150 ]; do echo "BIG.DATA.SET$i" echo "BIG.PDS(M$i)" i=$((i + 1)) done } >catalog PS1='$ ' ENV='' HISTFILE='' ZASH_TEST_CATALOG=$PWD/catalog \ python3 "$TESTS/tools/ptydrive.py" "$TSH" <<'END' # quoted absolute name: one qualifier at a time, lower case folded send echo "//'sys1.mac\t\t expect MACROS. send \x03 send echo "//'SYS1.MACL\t\r expect //'SYS1.MACLIB' # a qualifier with more below it ends in "." and takes another Tab send echo "//'SYS1.MACR\tO\t\r expect //'SYS1.MACROS.OLD' # a high-level qualifier on its own is not searched at all: a filter like # SYS* would have Catalog Management resolve aliases across catalogs send echo "//'SY\t\tZ\r expect //'SYZ send \x03 # members of a PDS, quoted and closed send echo "//'SYS1.MACLIB(GE\t\r expect //'SYS1.MACLIB(GETMAIN)' send echo "//'SYS1.MACLIB(\t\t expect IEFJFCB send \x03 # escaped instead of double-quoted: the editor adds the backslashes send echo //\\'SYS1.PARM\t\r expect //'SYS1.PARMLIB' # many entries: resume across work areas (the list is cut to one screen, # so the proof is that the 149th entry is still completable) send echo "//'BIG.DATA.SET1\t\t expect ... and send \x03 send echo "//'BIG.DATA.SET149\t\r expect //'BIG.DATA.SET149' send echo "//'BIG.PDS(M150\t\r expect //'BIG.PDS(M150)' # DD names send echo //DD:SYSP\t\r expect //DD:SYSPRINT # no match: bell, nothing inserted send echo "//'NOSUCH.\t\tZ\r expect //'NOSUCH.Z send \x03 send exit\r END