/* --------------------- rexx procedure ---------------------- * * Name: GET * * * * Function: ISPF EDIT Macro to copy the specified data set * * into the data set currently being processed by * * ISPF Edit. * * * * Syntax: GET dsname * * * * Author: Lionel B. Dyck * * Kaiser Permanente Information Technology * * 25 N. Via Monte Ave. * * Walnut Creek, CA 94598 * * (925) 926-5332 * * Internet: lbdyck@gmail.com * * * * History: * * 02/11/00 - fix after copy position * * 02/04/00 - fix width problem * * 01/13/92 - created by Lionel Dyck * * * * ------------------------------------------------------------- */ Address ISREDIT "MACRO (DSN) NOPROCESS" Address ISREDIT "PROCESS DEST" dest_rc = rc /* Insure that a parameter was specified */ if words(dsn) = 0 then do zedsmsg = "Error:" zedlmsg = "Correct syntax is: GET dsn" Address ISPEXEC "Setmsg Msg(ISRZ000)" exit 16 end /* Test to insure the data set exists */ x = sysdsn(dsn) if x <> "OK" then do zedsmsg = "" zedlmsg = "Error Specified data set:" dsn x Address ISPEXEC "Setmsg Msg(ISRZ000)" exit 16 end /* Verify that a destination was specified */ if dest_rc = 8 then do zedsmsg = "" zedlmsg = "A destination line must be specified" Address ISPEXEC "Setmsg Msg(ISRZ000)" exit 16 end /* Now read the specified data set */ dd_name = "GET"random() "Alloc f("dd_name") shr reuse ds("dsn")" "Execio * diskr" dd_name "(Finis Stem get." "Free f("dd_name")" /* Now default to Address ISREDIT */ Address ISREDIT /* get the current width of the data */ "(WIDTH) = DATA_WIDTH" /* Test to see if we have an empty edit data set and if so then set destination as after line 0 otherwise get the target line */ if dest_rc = 20 then dest = 0 else "(DEST) = LINENUM .ZDEST" save_dest = dest /* Now insert the data */ do i = 1 to get.0 newline = get.i "LINE_AFTER" dest "= DATALINE (NEWLINE)" dest = dest + 1 if width < length(get.i) then to_long = "On" end "UP MAX" "Down" save_dest if to_long = "On" then do zedsmsg = "Truncated?" zedlmsg = "Possible truncation of inserted data" Address ISPEXEC "SETMSG MSG(ISRZ000)" end exit 0