CAN WE INSERT FIELD IN PHYSICAL FILE BY USING OPNQRYF?

Answer Posted / manish kumar

MAPFLD is used to change the format of the fields used in
the OPNQRYF statement. When I say changing the format the
format of the field will not be changed but we can format
the data as we wish and store it in a diffrent variable.
For eg. You want check for year to be some value and are not
concerned abt date and month then you can follow as below.
OVRDBF FILE(FILEA) SHARE(*YES)
OPNQRYF FILE(FILEA) QRYSLT('YEAR *EQ "88" ') +
MAPFLD(YEAR '%SST(DATE 5 2)' *CHAR 2)
CALL PGM(PGMC)
CLOF OPNID(FILEA)
DLTOVR FILE(FILEA

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do you read data area in an rpg program?

1116


The content of Physical file is as below: hfcftp wruquief SENDPASV 0 CDUP ASCII GET 01100901.CSV ramndk/ECP505.EC0110090 (REPLACE QUIT Thw above commands will get executed when we call STRTCPFTP from CL program.... Now if I want to use SFTP what can be the solution? plz reply in detail....Thank you for ny help... I m using RPG/ILERPG to download...

1918


What are the mandatory keywords of sub file?

748


what are the various types of device files?

999


a multiple format logical file is also known as?

597






what are the two record formats a subfile contain ?

1127


what are different record spacing keywords in rlu ?

1210


which are the figurative constants used in rpg?

845


what is the difference between seton lr and retrn?

1292


what opcode will be used to test the zone of a character field?

1094


what is a spool file?

676


what does the opcode free do?

1131


an access path may be in which sequence?

635


what is the maximum number of fields under a record format of physical file?

1007


what is service program?

603