IBM DB400

  Home  Mainframes  IBM DB400


“IBM DB400 frequently Asked Questions by expert members with experience in IBM DB400. So get preparation for the IBM DB400 job interview”



26 IBM DB400 Questions And Answers

21⟩ Suppose i have a PF,it contains 5 members,how to access particular member data from logical file ?and what is the use of member in PF?

A1. Reading member 5 of myfilepf

CRTLF FILE(KCS/MYFILELF) SRCFILE(KCS/KC1) DTAMBRS

((KCS/MYFILEPF (MBR5)))

Or

ADDLFM FILE(KCS/MYFILELF) MBR(MYFILEBR) DTAMBRS

((KCS/MYFILEPF (MBR5)))

A2.For accounting purpose each month data can be stored as

12 different members.

So that we can easily access one month data or 12 months

together.

Easy to maintain 12 members in one PF file instead of 12 PF

Files.

 186 views

23⟩ How to read a PF in reverse(from last rec to first) using CL?

IN THIS EXAMPLE I M USING EMPFILE FOR READING IN REVERSE

ORDER.

PGM

DCLF FILE(EMPFILE)

OVRDBF FILE(EMPFILE) SHARE(*YES)

OPNQRYF FILE((EMPFILE)) KEYFLD((EMPNO *DESCEND))

READF: RCVF RCDFMT(MPFILR)

MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

GOTO READF

END:

ENDPGM

 181 views

26⟩ Maximum how many fields we can create under a record format of PF?

We can give max of 8000 fields in rec format of a PF.But it

also depend on the no. of bytes occupied by the record

formate.Because rec. format of PF may occupy atmax 32766

bytes.ie if there is only one field which occupy 32766

bytes then we can't define a new field in record format.

so it depend on the no. of bytes occupied by the field

defined in the record format.

Ex.

Char field - max value(32766 bytes)

variable length field - max value(32740 bytes)

allow null field - max value(32765)

variable & allownull field - max value(32739)

 158 views