13 liens privés
/ --- Rexx --------------------------------------------------------- /
/ Fonction EDIT d'un PDS ou d'un membre /
/ Paramètres : - néant /
/ Entrée : - néant /
/ Sortie : - néant /
/ ------------------------------------------------------------------ /
Address ISREDIT
"MACRO (DSN)"
"(LigCurs, ColCurs) = CURSOR"
if DSN = "DSN" then parse upper arg DSN
call initialisation
call lire_param
call restpref
exit
/----------------------------/
/ Initialisation des données /
/----------------------------/
initialisation:
fichier = ""
dsnpos = 0
call SavePref
return
/------------------------------------------/
/ Lecture et interprétation des paramètres /
/------------------------------------------/
lire_param:
Address ISREDIT
select
when length(DSN) = 0 then do
"(Lig, Col) = CURSOR"
"(LINEDATA) = LINE .ZCSR"
end
when datatype(DSN) = 'NUM' then do
"CURSOR="DSN" 0"
"(LINEDATA) = LINE .ZCSR"
end
when datatype(DSN) = 'CHAR' then do
fichier = DSN
dsnpos = 1
end
otherwise exit
end
Address ISPEXEC
if length(fichier) = 0 then do
lig=translate(LINEDATA,' ','=')
lig=translate(lig,' ',',')
dsnpos=wordpos('DSN',lig)
end
if dsnpos=0 then do
zedsmsg = ""
zedlmsg = "Pas de fichier ou de PDS sur la ligne"
"setmsg msg(isrz001)"
end
else do
if length(fichier) = 0 then fichier=word(lig,dsnpos+1)
bof = sysdsn(fichier)
if bof = 'OK' then do
Address TSO
"ALLOC DD(IN) DS("fichier") SHR REUSE"
"EXECIO * DISKR IN (STEM bof. FINIS"
"FREE F(IN)"
Address ISPEXEC
if bof.0 > 0 then
"browse dataset('"fichier"')"
else do
zedsmsg = "Fichier vide"
zedlmsg = ""
"setmsg msg(isrz001)"
end
end
else do
zedsmsg = "Fichier non catalogué"
zedlmsg = fichier' 'bof
"setmsg msg(isrz001)"
end
end
return
/---------------------/
/ save prefix routine /
/---------------------/
savepref:
Address ISREDIT
sprefx = '' / save prefix /
uprefx = userid() / user prefix /
prefx = sysvar(syspref) / get prefix variable /
if prefx <> '' then do / if profile prefix /
sprefx = prefx / save it /
"profile noprefix" / work without prefix /
end
return / return to caller /
/------------------------/
/ restore prefix routine /
/------------------------/
restpref:
Address ISREDIT
prefx = sysvar(syspref) / get prefix variable /
if prefx = '' then do / if profile noprefix /
if sprefx <> '' then do / if saved /
prefx = sprefx / restore it /
"profile prefix("prefx")" / work with prefix /
end
end
return / return to caller /