Professional Documents
Culture Documents
IBMDB400InterviewQuestionsandAnswers
InterviewQuestionsAnswers.ORG
InterviewerAndIntervieweeGuide
Home
AboutUs
ContactUs
Directory
Forum
SEARCH
IBMDB400QuestionsAndAnswers
AllCategories>> Mainframes>> IBMDB400 >>
IBMDB400jobinterviewquestionsandanswersguideline.LeanIBMDB400andgetpreparationforthejobof
IBMDB400
IBMAS400iSeries
IBMDatabase
JobIBM
CATEGORIES
LinuxOS
Mainframes
CICS
CLIST(CommandList)
IBMADABAS
IBMAS400
IBMAssembler
IBMCOBOL400
IBMCOOLPLEX
IBMDB400
IBMMainFrame
IBMMVS
IBMNatural
IBMOS2
IBMDB400guideupdatedat12Jan15inCategoryMainframesandvisited1840Times
IBMOS390
IBMQMF
IBMQSAM
IBMREXX
Download PDF
IBMRPG400
IBMSysplex
DO WNL O A D I B M DB 4 0 0 Q UE S TI O NS E B O O K
IDMS
IBMDB400QuestionsandAnswers:
IMSDB
SubmitYourQuestion
JCL
MQSeries
VSAM
1::LaststatementofanyRPGpgmisLR?
Management
Notnecessarily.LRisgenerallysetonafterall
processingisdoeni.e.attheendoftheprogrambutthere
isnohardandfastruleforthat.
IsThisAnswerCorrect? 1Yes
0No
Marketing
Medical
Microsoft.NetTechnologies
SubmitYourAnswer
Middleware
MobileOS
ADS
2::MaximumhowmanyfieldswecancreateunderarecordformatofPF?
Wecangivemaxof8000fieldsinrecformatofaPF.Butit
alsodependontheno.ofbytesoccupiedbytherecord
formate.Becauserec.formatofPFmayoccupyatmax32766
bytes.ieifthereisonlyonefieldwhichoccupy32766
bytesthenwecan'tdefineanewfieldinrecordformat.
soitdependontheno.ofbytesoccupiedbythefield
definedintherecordformat.
Ex.
Charfieldmaxvalue(32766bytes)
variablelengthfieldmaxvalue(32740bytes)
allownullfieldmaxvalue(32765)
variable&allownullfieldmaxvalue(32739)
IsThisAnswerCorrect? 0Yes
0No
SubmitYourAnswer
3::Howmanymax.Recordformatalogicalfilehave?
8000.thiscanvary,canbelesserifdateformat,
alphanumericfieldsareused.
IsThisAnswerCorrect? 0Yes
0No
SubmitYourAnswer
4::WhyJournallingiscompulsorybeforeCommitmentControl?
Commitmentctrlisusetosave/rollbackthegroupof
chagesandJournallingisusetosavethechangedrecords
inJorunalreciver.
IsThisAnswerCorrect? 0Yes
0No
http://interviewquestionsanswers.org/_IBMDB400
SubmitYourAnswer
1/5
3/25/2015
IBMDB400InterviewQuestionsandAnswers
5::WhywecreatethePhysicalFileMember?
AmemberislikeanIndividualfile.ItispossibletoHave
32767suchmemberswithinthesamePF.Eachmemberaddedto
thefilewillexactlygetthesamerecordformat(
fields,typesandKWDS)onthefile.Thisfacilityis
providedtomeettherequirementwhenmanyfilesareneeded
tobecreatedwithsamestructure.HerejustCreatefile
oncewithMAXMBRS(asmanyreqd)andADDPFMwilldoit.Easy
tocreateandmaintainasasingleobject.Eachmemberis
identifiedbyuniquenamewithinfile.
Examples:ASchoolhasattendanceregisterperclass.Each
Classhas4sectionsandinall10classes.Insteadof
Creatingandmaintaining40filesandscaterredina
library,onecancreateaPFandadd40membersinone
object.
SecondlyAllPhysicalfilescreatedneednotnecessarily
havemembers.Somefilesarecreatedtostorefield
definitonsonlyandarecalledfieldrefrencefiles.They
neednothavemembers.
IsThisAnswerCorrect? 0Yes
0No
CoirfitCoirfit
Daydream4.5Inches
PocketFriendly
ComfortSingleHome
FurnishingBUY
NOW23%Rs.
4179Rs.5446
SubmitYourAnswer
6::IsConstentcanbedefineasakeyfield?
FirstlyaConstantcannotbeapartofaFilefieldlist.
ThereisnomeaninginhavingaConstantintheKeyfield.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
7::IsitpossibletocreatealogicalfilewhosePhysicalfileisnotinsamelibrary?
Yes,Justputtheuserlibraryinwhichyouwanttocreate
ontopandfollowedbyotherlibraryinwhichphysicalfile
islocated.
providedthefirstlibraryshouldnothavephysicalfile.
Thentrytocreatethelogical.
IsThisAnswerCorrect? 2Yes
1No
CoirfitCoirfitTwin5
InchesDoubleZone
SleepingSystem
QueenHome
FurnishingBUY
NOW32%Rs.
5306Rs.7749
CoirfitCoirfitHealth
Boom4.5Inches
SpineSpecialist
QueenHome
FurnishingBUY
NOW34%Rs.
4220Rs.6397
SubmitYourAnswer
SHARETHIS
8::HowtoaddafieldtoaPFandcompileitwithoutlossofdata?
FirstAddthefieldswhateveryouwant
thenuseCHGPFcommand
Subscribe&GetUpdates
Physicalfile.........>MyPf
Library...........MyLib
System.............*LCL
Sourcefile..........MYSourceFile
Library...........MyLib
Subscribe
DeliveredbyFeedBurner
UpdatethePhysicalfile.Noneedtocompileagain.
IsThisAnswerCorrect? 3Yes
0No
SubmitYourAnswer
9::Howtofindthelistofsourcephysicalfilesinalibrary?
Isthereanywaytogetalist?
WRKOBJPDMLIB(KCS)OBJ(*ALL)OBJTYPE(*FILE)OBJATR('PFSRC')
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
10::SupposeihaveaPF,itcontains5members,howtoaccessparticularmemberdatafrom
logicalfile?andwhatistheuseofmemberinPF?
A1.Readingmember5ofmyfilepf
CRTLFFILE(KCS/MYFILELF)SRCFILE(KCS/KC1)DTAMBRS
((KCS/MYFILEPF(MBR5)))
Or
ADDLFMFILE(KCS/MYFILELF)MBR(MYFILEBR)DTAMBRS
((KCS/MYFILEPF(MBR5)))
A2.Foraccountingpurposeeachmonthdatacanbestoredas
12differentmembers.
Sothatwecaneasilyaccessonemonthdataor12months
together.
Easytomaintain12membersinonePFfileinsteadof12PF
Files.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
11::HowtoreadaPFinreverse(fromlastrectofirst)usingCL?
http://interviewquestionsanswers.org/_IBMDB400
2/5
3/25/2015
IBMDB400InterviewQuestionsandAnswers
INTHISEXAMPLEIMUSINGEMPFILEFORREADINGINREVERSE
ORDER.
PGM
DCLFFILE(EMPFILE)
OVRDBFFILE(EMPFILE)SHARE(*YES)
OPNQRYFFILE((EMPFILE))KEYFLD((EMPNO*DESCEND))
READF:RCVFRCDFMT(MPFILR)
MONMSGMSGID(CPF0864)EXEC(GOTOCMDLBL(END))
GOTOREADF
END:
ENDPGM
IsThisAnswerCorrect? 3Yes
0No
SubmitYourAnswer
12::Howtoretrieveaphysicalfileafterdeletingthat?Whatiskeywordusedforthat?
IntheDDstatement'sDISPparameterwriteDISP=KEEP.Andto
accessthefilewithdispositionKEEPweneedtosupplythe
volumesrailnumberasvol=ser=xxxx.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
13::WhenwecreateaPFanddidnotfillupMaintparameter,thenbydefaultwhichaccesspath
willthesystemtake&why?
AccessPathMaintparameteruse*IMMED.
Accesspathisupdatedeachtimearecordis
changed,added,ordeletedfromamember.
IsThisAnswerCorrect? 0Yes
0No
SubmitYourAnswer
14::IhavePhysicalfilewith100records,thereisnoanyduplicaterecordsinthispf.Basedonthis
pfoneLogicalfileihaveused.Butthislfisviewingonly80recordsonlyofthatpf?Whatisthe
reasonforthis?
IfthereisanyselectioncriteriainLFthenitmaybe
displayingaccordingly.Ifthereisno"Select"or"Omit"
itshoulddisplay100records.HavealookatLFonceagain.
IsThisAnswerCorrect? 0Yes
0No
SubmitYourAnswer
15::Howtoknowtheparticularrecordinpfwithoutreading?
you'llcometoknow
whethertherecordisfound.that'sall.
butnotwhat(value)isintherecord.
IsThisAnswerCorrect? 0Yes
0No
SubmitYourAnswer
16::Howtoknowlogicalfilebelongstowhichphysicalfilewithoutsource?
ifyoudoaDSPDBRona
logicalfileitwontshowyouthenameofthephysicalfile
thatitisbasedon.RatheryouneedtouseDSPFDonthe
logicalfile.DSPDBRonaphysicalfilewillshowthenames
ofalltheLFfilesbasedonthatPF.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
17::Whatisopendatapath?andwhatisthediffb/waccesspathandopendatapath?
Anaccesspathdescribestheorderinwhichtherowsare
retrievedfromadatabasefile.Iftherowsinthefileare
accessedinaphysicalsequence,thatisknownasan
arrivalsequenceaccesspath.Iftherowsneedtobe
processedinanorderedmanner,thenakeyedaccesspathis
neededtosortthedatainthespecifiedorder.WithDB2
foriSeries,keyedaccesspathsaresuppliedtoDB2by
creatingakeyedlogicalfile,keyedphysicalfile,orSQL
index.
Anaccesspathandanopendatapathareusedtogetherto
processtherowsinadatabasefile.
Theopendatapath(ODP)isthepaththroughwhichall
inputandoutputoperationsareperformedonadatabase
file.TheODPisusedtoconnecttherequestingprogram
withthedatainthefile.Asdataisretrievedfromor
insertedintothefile,theODPwilluseanaccesspathto
navigatetoarowwithininthefile.Iftherowsneedto
beprocessedinasortedowner,thensomeonewillneedto
supplyakeyedaccesspathbycreatingakeyedphysical
http://interviewquestionsanswers.org/_IBMDB400
3/5
3/25/2015
IBMDB400InterviewQuestionsandAnswers
file,keyedlogicalfileorSQLindex.
AnODPiscreatedandusedeachtimethatafileisopened
orwhenanSQLstatementisexecuted.Therearewaysto
haveanODPsharedorreusedinsteadofcreatingtheODP
eachtime.
IsThisAnswerCorrect? 2Yes
0No
SubmitYourAnswer
18::Howtoupdatephysicalfileusinglogicalfilewithexample?
DeclarethelogicalfileinupdatemodeintheRPGprogram.
Chainattherecordneededtobeupdatedandaferchanging
thefieldvalueuseUPDATEopcodewiththerecordformat
nameoftheLF.Therecordgetsupdated
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
19::Howtoupdatephysicalfilesusingnormallogicalfile?
ToUpdatephysicalfileinRPGuseopcodeUPDATE.
example
FLF1IFEkDISK
key1SetllLF1
READLF1
UPDATELF1
Note:Logicalfileshouldbesimeplelogicalfile.Wecan't
updatephysicalfilewithhelpofJoinlogicalfile.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
20::Onephysicalfilecanhavehowmanymaxoflogicalfiles?whatistheprimaryfile?
onephysicalfilecanhavemorethanonelogicalfiles.
priamaryfileisusedinrpgprogramcycletoautomatically
readrecordsinacycle
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
21::whatistheinteractivejob?whatisthebatchjob?Howtochangethebatchjobtointeractive
job?
WhenyousignonanAS/400system,youareinteractingwith
interactivejobs(e.g.QINTER).TheSystemjobswhichare
presubmittedarecalledbatchjobs(e.g.QBATCH,QSPL,QCMNetc.,)
IfuwanttoknowwhetherajobisinInteractiveorBatch,
ucanuseRTVJOBAcommandwithattributeJOBTYPEonthatjob.
ifithasavalue'1'=Interative'0'=Batch.
youcanchangeaBatchjobtoInteractivejobaslongasit
isinJOBQ(bychangingtheenvironmentonCHGJOB(opt2)
commandtoQINTERorQPGMR)onceit'sactivewecannot
changethetype.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
22::Whatisthepurposeofthechainandsetllandsetgt?
CHAINisusedforrandomretrievalfromaFile.Inother
words,whatevervalueusedbyprogrammerinFactor1/Key
againstCHAINopcodewillbeusedassearch/findcriteriain
databasefile.NOVALUERETRIEVEDINNOCRITERIAMATCH.It
canbewellunderstand,incaseofusingcompositekeys.
ButincaseofSETLLandSETGT,programwillreturnsome
value,ifanyvaluepresentinthedatabase/physicalfile.
CHAIN=Setspointeronexactvalue
SETLL=SetspointeronLowerLimitofthevalue
SETGT=SetspointeronGreaterLimitofthevalue
==========================================================
Itisrecommended,useCHAINonly,ifrecordexistin
databasefile,insteadofSETLLandSETGT,whichcanbeused
otherwise.
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
23::Apfcontaining100records...myqueryishowtodisplayfrom11threcordinthepf?
WecanpositionedtonthrecordinfileinCLwiththehelpofOVRDBFcommand.
http://interviewquestionsanswers.org/_IBMDB400
4/5
3/25/2015
IBMDB400InterviewQuestionsandAnswers
Synatax:
OVRDBFFILE(filename)POSITION(*RRN11)
Thiswillpositionedfileon11threcordsoRCVFcommandwillread11threcordinfile.
Ifyouwanttoreadwithkeyconditionedthenwecanspecify*KEY,*KEYA,KEYAEetctopositionedwithkey
specifiedincommand.
IsThisAnswerCorrect? 1Yes
SubmitYourAnswer
0No
24::Ihadcreatedonephysicalfiletellmecommandtoenterdatainto?
bytheuseofthecmdUPDDTAPfnameusecanenterthedata
intothephysicalfile.Note:dn'tcompilethepfafter
enteringthedataintothepf.
IsThisAnswerCorrect? 2Yes
SubmitYourAnswer
0No
25::Canweconcatenatefieldsinphysicalfile?Ifyeshowcanwedo?
No,wecannotconcatfieldsinPhysicalFile.However,in
logicalfile,wecanconcat2ormorefieldstogetherinto1
field.formatis..
nameconcat(fnamemnamelname)
IsThisAnswerCorrect? 1Yes
0No
SubmitYourAnswer
26::Howtoknowtotalnoofrecordsinpfwithoutusingsql?
Byusingdspfdcommandyoucanfindouttotalonrecord.
dspfd(libname/filename)
hereucanfindouttotalnoofrecords.
1.ThroughtheRPGprogram,OpenFeedbackInformationof
FileInformationdatastructure(INFSR)willgivethecount
ofrecordsinthephysicalfile.
2.ThroughCLcommand,RetrieveMemberDescription(RTVMBRD)
willgivetheno.ofnondeletedrecordsthroughNBRCURRCD
variable.
IsThisAnswerCorrect? 2Yes
0No
SubmitYourAnswer
PrivacyPolicy|TermsandConditions|ContactUs
http://interviewquestionsanswers.org/_IBMDB400
5/5