Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Pl1/     Datei vom 5.9.2011 mit Größe 844 B image not shown  

Quelle  GETDSN.REXX   Sprache: REXX

 

/* REXX - mit Cursor markierte Datei wird als Parameter             */          
/* zurückgegeben                                                   */           
/*                                                                  */          
                                                                                
/* trace i */                                                                   
Version     = "Version 0.80 vom 19.02.2003"                                     
Autor       = "JD"                                                              
Redakteur1  = "NN"                                                              
                                                                                
address "ISREDIT"                                                               
"MACRO (DUMMY) NOPROCESS"                                                       
if rc /= 0 ! dummy="?" then do                                                  
   call help                                                                    
   exit(12)                                                                     
end                                                                             
"(ZEILE) = LINE .ZCSR"                                                          
upper zeile                                                                     
"(LIN,COL) = CURSOR"                                                            
"(DSN) = DATASET"                                                               
"CURSOR =" lin col                                                              
address "ISPEXEC" "CONTROL ERRORS RETURN"                                       
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#$@0123456789"  /* gültige Zeichen */        
seps  = ".()+-"                                    /* Trennzeichen */           
if lin = 0 ! col = 0 then                                                       
do                                                                              
  call message "Cursor not on data field"                                       
  exit 4                                                                        
end                                                                             
/* Suche nach links das 1. ungültige Zeichen */                                 
i = col                                                                         
do i = col to 1 by -1 while pos(substr(zeile,i,1),chars!!seps) > 0              
end                                                                             
anfang = i + 1                                                                  
do j = anfang by 1 while pos(substr(zeile,j,1),seps) > 0                        
end                                                                             
anfang = j                                                                      
/* Suche nach rechts das 1. ungültige Zeichen */                                
do i = anfang by 1 while pos(substr(zeile,i,1),chars!!seps) > 0                 
end                                                                             
ende = i - 1                                                                    
datei = substr(zeile,anfang,ende-anfang+1)                                      
if pos("(",datei) = 0  then                                                     
  if pos(")",datei) > 0 then                                                    
    ende=ende-1                                                                 
datei = substr(zeile,anfang,ende-anfang+1)                                      
/* nach (+1) oder (-1) untersuchen */                                           
if pos("+",datei) > 0 ! pos("-",datei) > 0 then do                              
   p=pos("+",datei)                                                             
   if p=0 then                                                                  
     p=pos("-",datei)                                                           
   datei=substr(datei,1,p-2)!!".*"                                              
   call dlist datei                                                             
   do i=1 to queued()                                                           
      pull last                                                                 
   end                                                                          
   datei=last                                                                   
end                                                                             
/* Dateiname steht fest */                                                      
if datei = "" then                                                              
do                                                                              
  call message "No dsn found"                                                   
  exit 4                                                                        
end                                                                             
/* Falls nur Membername */                                                      
if pos(".",datei) = 0,                                                          
!  pos(".",datei) = length(datei) then                                          
do                                                                              
  /* Entferne führende Separatoren */                                           
  do while pos(substr(datei,1,1),seps) > 0                                      
    datei = substr(datei,2)                                                     
    if datei = "" then                                                          
    do                                                                          
      call message "No dataset name specified"                                  
      exit 4                                                                    
    end                                                                         
  end                                                                           
  /* Entferne nachlaufende Separatoren */                                       
  do while pos(substr(datei,length(datei),1),seps) > 0                          
    datei = substr(datei,1,length(datei)-1)                                     
    if datei = "" then                                                          
    do                                                                          
      call message "No dataset name specified"                                  
      exit 4                                                                    
    end                                                                         
  end                                                                           
  if datatype(left(datei,1),"NUM") then                                         
  do                                                                            
    call message "Illegal member name" datei                                    
    exit 4                                                                      
  end                                                                           
  if length(datei) > 8 then                                                     
  do                                                                            
    call message "Membername too long:" datei                                   
    exit 4                                                                      
  end                                                                           
  /* look up in copybooks */                                                    
  d=copybook(datei)                                                             
  if d /= "not found" then                                                      
     datei=substr(d,2,length(d)-2)                                              
end                                                                             
"CURSOR = (LIN,COL)"                                                            
return datei                                                                    
/* Programm Ende */                                                             
                                                                                
/* Fehlerroutinen */                                                            
message: procedure                                                              
zedsmsg=arg(1)                                                                  
zedlmsg=arg(1)                                                                  
address "ISPEXEC" "SETMSG MSG(ISRZ001)"                                         
"CURSOR = (LIN,COL)"                                                            
return ""                                                                       
/* Programm Ende */                                                             
                                                                                
HELP:                                                                           
say '                                                                '          
say 'ISPF/PDF REXX procedure to identify the dataset on cursor       '          
say 'position and return it                  '                                  
say '                                                                '          
say 'To run:                                                         '          
say '1. place the cursor on the dataset/member                       '          
say '                                                                '          
say '2. Press ENTER                                                  '          
say '                                                                '          
say '3. If you have questions about this command,                    '          
say '   contact Hamburg -4244.                                       '          
Return                                                                          

Messung
CHZG
90807481

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet am  2026-11-23) ¤

*© Formatika GbR, Deutschland