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

what if my system I runs with system value qccsid 65535?

628


how you will find an error which is not in the first page of the subfile without using rolldown key?

574


What is diff between EVAL & MOVE?

985


in conjunction with which statements can orxx and andxx conditions be used ?

1153


how can you execute a command from within an rpg program without calling a clp program?

1215






how to write code for singlepage in sqlrpgle with update ?

2375


which of the cl command can be used to determine which logical files are dependent on a specific file?

602


Can any one explain the basic things about RLU and Printer Files and their Definitions for both and why are they used,i'm a newbee so please help me out

2920


what is overlay?

695


Hi,Can any body give the code for the below mentioned quetion.?Im trying to get coding in with easily inderstanding.Plese give me the coding for this? 1.How would you achieve this requirement with out using RPG/RPGLE pgm,but by using only CL?Read a database file and display file contents on the screen when enter key pressed the next record should be displayed on screen.When the last record is reached or when F3 key is pressed the program should exit if the file is empty,a message should be displayed indicate that there are no records to display. Database file Name=EMPDBF Fields in EMPDBF to be displayed on screen Employee Number- EMPNUM(5,0) Employee Name- EMPNAM(30,A) Employee Address-EMP ADDR(50 A)

1749


which are the figurative constants used in rpg?

857


WHAT IS AS/400 SYNORIO?

2893


what is the function of cpyf command?

1032


explain the use of dftwrt display keyword?

1155


what keyword must be used with protect keyword ?

1142