1.

How To Read A Pf In Reverse(from Last Rec To First) Using Cl?

Answer»

In this example empfile for reading in reverse ORDER is used.

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

In this example empfile for reading in reverse order is used.

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



Discussion

No Comment Found