callcop1 = 'ZVS.ALL.COBOL'/* Test-Library for called pgms */
callcop2 = 'XTRNCLS.T.COBOL' /* Work-Library for called pgms */ address ispexec 'isredit (,col) = CURSOR'
parm1 = translate(parm1) if parm1 = 'T'then trace ?R
if col = 0 then do
zedsmsg = 'Invalid cursor position'
zedlmsg = 'Please, set the cursor in the Edit Area' 'setmsg msg(isrz001)' exit(12) end
'isredit (maxcol) = DATA_WIDTH' 'isredit (line) = LINE .ZCSR'
i = 0
/* An den Anfang des Names gehen, bis SPACE, Hochkomma, Komma */ /* Punkt oder '=' gefunden */ do i = col to 1 by -1 , while ( substr(line, i, 1) /= " " ) & ,
( substr(line, i, 1) /= "'" ) & ,
( substr(line, i, 1) /= "," ) & ,
( substr(line, i, 1) /= "." ) & ,
( substr(line, i, 1) /= "=" ) nop end
/* Wenn Name am linken Rand steht, war Auswahl falsch */ if i = 1 then do
zedsmsg = 'Invalid select' msg = 'Please, set the cursor on the Copy-Member to be edited'
zedlmsg = msg 'setmsg msg(isrz001)' exit(12) end
/* set index on first character of name */
col_anf = i + 1
/* Ausgehend von Spalte col den nä. space, das nä. Hochkomma, */ /* den nä. Punkt oder das nä. Komma suchen */ do i = col_anf to maxcol by 1 , while ( substr(line, i, 1) /= ' ' ) & ,
( substr(line, i, 1) /= "'" ) & ,
( substr(line, i, 1) /= '.' ) & ,
( substr(line, i, 1) /= ',' ) nop end
/* set index on last character of name */
col_end = i - 1
/* compute length of name and evaluate name */
col_len = col_end -col_anf + 1
name = substr(line, col_anf, col_len)
'control errors return'
/* Wenn *COPY-Zeile, dann direkt Copy-Lib scannen */
copy_lit = substr(line, 1, 5) if copy_lit ^= '*COPY'then , do /* Try to edit member 'name' in current PO-Dataset */
dsn_edit = "'" !! dsn !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' end
if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with copy_1 */
dsn_edit = "'" !! copy_1 !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with copy_2 */
dsn_edit = "'" !! copy_2 !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with copy_3 */
dsn_edit = "'" !! copy_3 !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with 'GROPSYS.PROGRAMS.SOURCE' */
dsn_edit = "'" !! callcop2 !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with 'SYS1.MACLIB' */
dsn_edit = "'" !! maclib !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do /* try with 'SYS1.ALBMAC' */
dsn_edit = , "'" !! alblib !! "(" !! name !! ")'" interpret'dsn_vorh = sysdsn("'dsn_edit'")' if dsn_vorh = 'OK'then 'edit dataset('dsn_edit')' else do
zedsmsg = 'Member not found'
zedlmsg = 'Member 'name' was not', 'found in any', 'CALL-, MAC- or COPY-library' 'setmsg msg(isrz001)' exit(24) end/* Dataset ist nicht vorhanden */ end/* try with 'SYS1.ALBMAC' */ end/* try with 'SYS1.MACLIB' */ end/* try with 'GROPSYS.PROGRAMS.SOURCE' */ end/* try with copy_3 */ end/* try with copy_2 */ end/* try with copy_1 */
/* Return-Code after leaving the edited source */
end_edc: select when rc = 0 then do
zedsmsg = 'Data saved'
zedlmsg = 'Data was saved in Dataset 'dsn_edit 'setmsg msg(isrz000)' end when rc = 4 then do
zedsmsg = 'Data not saved'
zedlmsg = 'Data in Dataset 'dsn_edit' was not saved' 'setmsg msg(isrz000)' end when rc = 14 then do
zedsmsg = 'Dataset in use'
zedlmsg = 'Dataset 'dsn_edit' is in use by another job or user' 'setmsg msg(isrz001)' end when rc = 16 then do
zedsmsg = 'Empty Dataset'
zedlmsg = 'Dataset 'dsn_edit' is empty or member not found' 'setmsg msg(isrz001)' end otherwise do
zedsmsg = 'Empty Dataset'
zedlmsg = 'Dataset 'dsn_edit' is empty or member not found' 'setmsg msg(isrz001)' end end
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.