|
Hello Ben, Here's a sample of the QDBRTVFD API that Simon mentioned. It's not as straight forward an API as the QUSRMBRD API - but it does offer quite a lot more information -whether you need it or not :-) **-- Header pecifications: --------------------------------------------** H BndDir( 'QC2LE' ) Option( *SrcStmt ) **-- API error data structure: D ERRC0100 Ds Qualified D BytPro 10i 0 Inz( %Size( ERRC0100 )) D BytAvl 10i 0 Inz D MsgId 7a D 1a D MsgDta 128a **-- API return parameter: D FilRtnQ Ds Qualified D FilNam 10a D LibNam 10a **-- Global constants: D SRC_FILE c 4 D PGM_DESC c 7 **-- Global variables: D FilTyp s 3a D FilDsc s 3a **-- FILD0100 formats: D Qdb_Qdbfh Ds Qualified D Qdbfyret 10i 0 D Qdbfyavl 10i 0 D Qdbfhflg 2a D Reserved_7 4a D Qdbflbnum 5i 0 D Qdbfkdat 14a D Qdbfknum 5i 0 Overlay( Qdbfkdat: 1 ) D Qdbfkmxl 5i 0 Overlay( Qdbfkdat: *Next ) D Qdbfkflg 1a Overlay( Qdbfkdat: *Next ) D Qdbfkfdm 1a Overlay( Qdbfkdat: *Next ) D Reserved_10 8a Overlay( Qdbfkdat: *Next ) D Qdbfhaut 10a D Qdbfhupl 1a D Qdbfhmxm 5i 0 D Qdbfwtfi 5i 0 D Qdbfhfrt 5i 0 D Qdbfhmnum 5i 0 D Reserved_11 9a D Qdbfbrwt 5i 0 D Qaaf 1a D Qdbffmtnum 5i 0 D Qdbfhfl2 2a D Qdbfvrm 5i 0 D Qaaf2 2a D Qdbfhcrt 13a D Qdbfhtx 52a D Reserved_18 2a Overlay( Qdbfhtx: 1 ) D Qdbfhtxt 50a Overlay( Qdbfhtx: *Next ) D Reserved_19 13a D Qdbfsrc 30a D Qdbfsrcf 10a Overlay( Qdbfsrc: 1 ) D Qdbfsrcm 10a Overlay( Qdbfsrc: *Next ) D Qdbfsrcl 10a Overlay( Qdbfsrc: *Next ) D Qdbfkrcv 1a D Reserved_20 23a D Qdbftcid 5i 0 D Qdbfasp 2a D Qdbfnbit 1a D Qdbfmxfnum 5i 0 D Reserved_22 76a D Qdbfodic 10i 0 D Reserved_23 14a D Qdbffigl 5i 0 D Qdbfmxrl 5i 0 D Reserved_24 8a D Qdbfgkct 5i 0 D Qdbfos 10i 0 D Reserved_25 8a D Qdbfocs 10i 0 D Reserved_26 4a D Qdbfpact 2a D Qdbfhrls 6a D Reserved_27 20a D Qdbpfof 10i 0 D Qdblfof 10i 0 D Qdbfssfp 6a D Qdbfnlsb 1a Overlay( Qdbfssfp: 1 ) D Qdbflang 3a Overlay( Qdbfssfp: *Next ) D Qdbfcnty 2a Overlay( Qdbfssfp: *Next ) D Qdbfjorn 10i 0 D Qdbfevid 10i 0 D Reserved_28 14a **-- Retrieve database file description: D RtvDbfDsc Pr ExtPgm( 'QDBRTVFD' ) D RdRcvVar 32767a Options( *VarSize ) D RdRcvVarLen 10i 0 Const D RdFilRtnQ 20a D RdFmtNam 8a Const D RdFilNamQ 20a Const D RdRcdFmtNam 10a Const D RdOvrPrc 1a Const D RdSystem 10a Const D RdFmtTyp 10a Const D RdError 32767a Options( *VarSize ) **-- Test bit in string: D tstbts Pr 10i 0 ExtProc( 'tstbts' ) D String * Value D BitOfs 10u 0 Value /Free RtvDbfDsc( Qdb_Qdbfh : %Size( Qdb_Qdbfh ) : FilRtnQ : 'FILD0100' : 'QRPGSRC *LIBL ' : '*FIRST' : '0' : '*LCL' : '*EXT' : ERRC0100 ); If ERRC0100.BytAvl = *Zero; If tstbts( %Addr( Qdb_Qdbfh.Qdbfhflg ): SRC_FILE ) = 1; FilTyp = 'SRC'; Else; FilTyp = 'DTA'; EndIf; If tstbts( %Addr( Qdb_Qdbfh.Qaaf ): PGM_DESC ) = 1; FilDsc = 'PGM'; Else; FilDsc = 'EXT'; EndIf; EndIf; *InLr = *On; Return; /End-Free Best regards, Carsten Flensburg ----- Original Message ----- From: <Ben_Pforsich@xxxxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Tuesday, May 31, 2005 9:13 PM Subject: How to tell *FILE object is PF-DTA or PF-SRC > I need to be able to determine if a physical file is a data or source > physical file in RPG IV. I thought the QUSROBJD API could be used for > this, but I don't see how. The attribute returned is always "PF" > regardless. Any ideas?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.