[NEWSboard IBMi Forum]

Hybrid View

  1. #1
    Registriert seit
    Jan 2007
    Beiträge
    189
    1. Scott Klement wrote an article (SystemiNetwork) with the code included in which he described how to create an SQL UDTF which returns all the objects in a directory. This means that one can just run an sql statement and voila!, you have a list. As is usual with Mr. Klements' stuff, it's brilliant. I've tested this and it works very well. I've also modded it a bit in that the directory can be passed as a parameter. But it is slow, due to a) It's IFS and b) you have to continually open and close the SQL cursor for each directories/sub-directory.

    2. This article and the subsequent testing made me think more about this and came up with the following. What you can also use is the QSH commands and list the contents of a directory (and optionally all sub-directories) to STDOUT. Now you could parse through the output but that's tiresome. Again using SQL (and views), you can now display your list. But the drawback on this way is that it's not real-time. You must refresh the list continually. On the upside, you are not continually opening & closing the SQL cursor for each directory.

    Hope this helps.
    mfg

    Kit
    www.ecofitonline.com
    DeskfIT - ChangefIT - XrefIT

  2. #2
    Registriert seit
    May 2002
    Beiträge
    1.121
    Hatte da mal ein kleine RPG gemacht
    PHP-Code:
    H Option( *SrcStmt DftActGrp( *No BndDir'QC2LE' )                    
    h datfmt(*dmy.) timfmt(*hms:) datedit(*dmy.) decedit('0,'debug(*yes)     
     *                                                                         
     * 
    CHK_IFS-  Testen ob die Datei im IFS schon da ist                       
     
    *                                                                         
                                                                               
                                                                               
    d File            s               *                                        
    d                                                                          
    d PM_File         s            255                                         
    d PM_Return       s               n                                        
    d                                                                          
    d True            c                   
    *On                                  
    d False           c                   
    *Off                                 
    d                                                                          
     
    *-- IFS stream file functions: -----------------------------------**      
    d open            Pr              *   ExtProc'_C_IFS_fopen' )            
    d                                 *    Value Options( *String )            
    d                                 *    Value Options( *String )            
                                                                               
    c     *Entry        PList                                                  
    c                   Parm                    PM_File                        
    c                   Parm                    PM_Return                      
    c                                                                          
    C                   
    Eval      File   Open( %TrimPM_File )              
    C                                          'r'                )          
    **                                                                         
    C                   If        File   = *Null                               
    C                   
    Eval      PM_Return   False                          
    C                   
    Else                                                   
    C                   Eval      PM_Return   True                           
    c                   
    EndIf                                                  
    c                                                                          
    c                   
    Eval      *InLr True 
    Gruß Ronald

  3. #3
    Registriert seit
    Feb 2001
    Beiträge
    20.695
    Das Problem beim Open ist, dass Zugriffszeiten aktualisiert werden.

    Ausserdem solltest du den Close nicht vergessen, da hier die Ressourcen nicht automatisch freigegeben werden!
    Wenn du das häufiger in einem Job machst, gehen dir die Ressourcen irgendwann aus.
    "Access()" ist da besser.
    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

  4. #4
    Registriert seit
    May 2002
    Beiträge
    1.121
    Okay, Danke
    Wieder was dazu gelernt!

Similar Threads

  1. Berechtigungen im IFS zuweisen
    By ChrisX in forum IBM i Hauptforum
    Antworten: 9
    Letzter Beitrag: 03-12-07, 12:07
  2. Dateien per FTP von IFS auf der AS400 holen
    By kroehn in forum NEWSboard Windows
    Antworten: 5
    Letzter Beitrag: 08-11-06, 19:36
  3. Allgemeine Berechtigung für Jobs ... IFS Ordner ...
    By bode in forum IBM i Hauptforum
    Antworten: 1
    Letzter Beitrag: 30-10-06, 11:10
  4. Datei im IFS auf iSeries verschlüsseln
    By jo400 in forum IBM i Hauptforum
    Antworten: 1
    Letzter Beitrag: 21-10-06, 17:57
  5. Windowstabelle wird im IFS in CCSID 1252 erstellt
    By umeis in forum NEWSboard Windows
    Antworten: 3
    Letzter Beitrag: 11-08-06, 12:45

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •