Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to identify SRC-PF by program?

462 views
Skip to first unread message

Michael Hellriegel

unread,
Jan 29, 2004, 4:36:04 AM1/29/04
to
Hi group,

DSPFD FILE(SRC_MDL) TYPE(*ATR) actually does specify the file type of a
source file as 'physical *SRC' and WRKOBJPDM can do the same. However,
TYPE(*ATR) is not allowed on the DSPFD with the OUTFILE option.

I've gone through the object and file API documentation, but with no
result.

Any suggestions (besides converting the splf) to solve this problem are
welcome.

Michael Hellriegel

thomas....@gfd.de

unread,
Jan 29, 2004, 6:01:35 AM1/29/04
to
Hi Michael,

You have the following option to check for a source file:

1. Specify *PF for the FILEATR parameter of the DSPFD command, e.g.:

DSPFD FILE(RADDATZ/QSRC) TYPE(*ATR)
OUTPUT(*OUTFILE) FILEATR(*PF)
OUTFILE(QTEMP/DSPFD)

2. Within a RPG program check the source file indicator at offset 82 (=
position 163) of the "Common I/O Feedback" area of the file information
data structure. If it contains "Y" then it is a source physical file.

DOPNFBK DS ¦
D ODP_TYPE 81 82 * ODP Type ¦
D FILE_NAME 83 92 * File name ¦
D LIBRARY 93 102 * Library name ¦
D SPOOL_FILE 103 112 * Spool file name ¦
D SPOOL_LIB 113 122 * Spool file lib ¦
D SPOOL_NUM 123 124I 0 * Spool file num ¦
D RCD_LEN 125 126I 0 * Max record len ¦
D KEY_LEN 127 128I 0 * Max key len ¦
D MEMBER 129 138 * Member name ¦
D TYPE 147 148I 0 * File type ¦
D ROWS 152 153I 0 * Num PRT/DSP rows ¦
D COLUMNS 154 155I 0 * Num PRT/DSP cols ¦
D NUM_RCDS 156 159I 0 * Num of records ¦
D ACC_TYPE 160 161 * Access type ¦
D DUP_KEY 162 162 * Duplicate key? ¦
D SRC_FILE 163 163 * Source file? ¦
D VOL_OFF 184 185I 0 * Vol label offset ¦
D BLK_RCDS 186 187I 0 * Max rcds in blk ¦
D OVERFLOW 188 189I 0 * Overflow line ¦
D BLK_INCR 190 191I 0 * Blk increment ¦
D FLAGS1 196 196 * Misc flags ¦
D REQUESTER 197 206 * Requester name ¦
D OPEN_COUNT 207 208I 0 * Open count ¦
D BASED_MBRS 211 212I 0 * Num based mbrs ¦
D FLAGS2 213 213 * Misc flags ¦
D OPEN_ID 214 215 * Open identifier ¦
D RCDFMT_LEN 216 217I 0 * Max rcd fmt len ¦
D CCSID 218 219I 0 * Database CCSID ¦
D FLAGS3 220 220 * Misc flags ¦
D NUM_DEVS 227 228I 0 * Num devs defined ¦

3. You can use the "Retrieve Member Description (QUSRMBRD)" API, format "MBRD0100" to check
for a source file. Just specify *FIRST for the member name.

4. You can use the "Retrieve Database File Description (QDBRTVFD)" API, format "FILD0100". The
"File Definition Header" contains the source file indicator at offset 8,
bit 4. (I can provide a sample code.)

Regards,

Thomas Raddatz.

jb

unread,
Jan 29, 2004, 10:20:53 AM1/29/04
to
<thomas....@gfd.de> wrote in message news:4018e80f$1...@news.piro.net...
Hi Michael,

Regards,

Thomas Raddatz.

You can use DSPFD ... TYPE(*BASATR) & get the same thing without specifying
FILEATR(*PF) which returns an S in the filetype column.
--
Jonathan.


Michael Hellriegel

unread,
Mar 24, 2004, 9:51:24 AM3/24/04
to
looks like my replies didn't make it into the newsgroup :-(

So here a late Thank You to Thomas and Jonathan for their helpfull
replies and one additional information on the IMHO fastest way to
identify all source files on an iseries system:

SELECT * FROM qsys/QADBXREF where DBXTYP = 'S'

I recovered this information from an old note in one of my internal 'tip
files' which states the News/400 magazine (11/1999) as source. (My
biological ASP (aka brain) seems to have reached its capacity limits ;-)

Michael Hellriegel

0 new messages