/* REXX POPUTBL Populate the USERTBL for FINDLIBS from the USER table from ALLUSERS. */ arg argline /* pro-forma quick-start */ address TSO arg parms "((" opts opts = Strip( opts,'T','5d'x ) parse var opts "TRACE" tv . parse value tv "N" with tv . rc = Trace( "O" ); rc = Trace( tv ) isptlib = "'fclarke.personal.isptlib'" @tn@ = "USER" address ISPEXEC "LIBDEF ISPTLIB DATASET ID( "isptlib" ) STACK" "TBSTATS" @tn@ "STATUS1( s1 ) STATUS2( s2 )" if s1 > 1 then do zerrsm = "Table" @tn@ "not available." say zerrsm zerrlm = "Table" @tn@ "not found in the ISPTLIB library chain" "SETMSG MSG( ISRZ002 )" sw.0error_found = "1"; return end; else, if s2 = 1 then do /* table is not open */ "TBOPEN " @tn@ "NOWRITE" if rc > 4 then do sw.0error_found = 1 zerrsm = "Table did not OPEN" zerrlm = "Table" @tn@ "cannot be opened due to prior", "enqueues." "SETMSG MSG( ISRZ002 )" end end else "TBTOP" @tn@ address TSO "NEWSTACK" do forever "TBSKIP" @tn@ if rc > 0 then leave queue suuser end /* forever */ rc = Trace( "O" ); rc = Trace( tv ) "TBEND" @tn@ @tn@ = "UTBL" "TBSTATS" @tn@ "STATUS1( s1 ) STATUS2( s2 )" if s1 > 1 then do zerrsm = "Table" @tn@ "not available." say zerrsm zerrlm = "Table" @tn@ "not found in the ISPTLIB library chain" "SETMSG MSG( ISRZ002 )" sw.0error_found = "1"; return end; else, if s2 = 1 then do /* table is not open */ "TBOPEN " @tn@ "WRITE " if rc > 4 then do sw.0error_found = 1 zerrsm = "Table did not OPEN" zerrlm = "Table" @tn@ "cannot be opened due to prior", "enqueues." "SETMSG MSG( ISRZ002 )" end end else "TBTOP" @tn@ "LIBDEF ISPTLIB" "TBSORT" @tn@ "FIELDS( USERID,C,A )" rc = Trace( "O" ); rc = Trace( tv ) do queued() pull userid "TBMOD" @tn@ "ORDER" end /* queued */ rc = Trace( "O" ); rc = Trace( tv ) "TBCLOSE" @tn@ address TSO "DELSTACK" exit /*@ POPUTBL */