-
IFS-Command(s)
Hallo I-Series -Kollegen
Ich suche nach einem Command(s), mit dem man im IFS die Existenz einer PC-Datei feststellen kann, um diese vor einer erneuten Übertragung umzubennen bzw. zu löschen.
Besten Dank schon einmal
L.Anderer
-
Hallo,
QSYS/RNM OBJ('/ich') NEWOBJ('wir')
führt zur Meldung CPFA0A9
Nachricht . . . : Objekt nicht gefunden. Das Objekt ist /ich.
wenn das Objekt nicht da ist.
Gruß
C.Schulz
-
Hallo.
Da fällt mir jetzt spontan ein primitives CLP ein welches mittels Test so alá CPYTOIMPF oä und einem MONMSG die alte Datei umbenennt oder löscht bevor die neue Übertragen oder erstellt wird.
Das ist aber eine der vielen Möglichkeiten um sowas zu bewerkstelligen.
Edit: Sorry... Da war wohl wer schneller als ich *gg*
Lg
Christian Brunner
Last edited by prsbrc; 07-01-10 at 14:31.
Grund: Doppelt-gemoppelt
-
IFS-Command(s)
Danke für die schnelle Nachricht !
L.A.
-
Oder mit CHKOUT und anschließendem CHKIN, falls der CHKOUT funktioniert hat.
-
das C API access ist dein Freund (Beispiel ist in meinen OpenSource Komponenten zu finden)
D*B
Zitat von Anderer, Ludwig
Hallo I-Series -Kollegen
Ich suche nach einem Command(s), mit dem man im IFS die Existenz einer PC-Datei feststellen kann, um diese vor einer erneuten Übertragung umzubennen bzw. zu löschen.
Besten Dank schon einmal
L.Anderer
-
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.
-
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( %Trim( PM_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
-
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.
-
Okay, Danke
Wieder was dazu gelernt!
Similar Threads
-
By ChrisX in forum IBM i Hauptforum
Antworten: 9
Letzter Beitrag: 03-12-07, 12:07
-
By kroehn in forum NEWSboard Windows
Antworten: 5
Letzter Beitrag: 08-11-06, 19:36
-
By bode in forum IBM i Hauptforum
Antworten: 1
Letzter Beitrag: 30-10-06, 11:10
-
By jo400 in forum IBM i Hauptforum
Antworten: 1
Letzter Beitrag: 21-10-06, 17:57
-
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
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks