This is my Physical file 'EMPS' existing in library "TAMIL1"
and its record format is 'EMPRCD"
a)its source is
R EMPRCD
ENO 4 0
ENAME 10
EADD 10
b)The records present in EMPS are as follows
ENO ENAME EADD
0001 tamil coimbatore
0002 kumar bangalore
0003 sunder bangalore
0004 arunkumar chennai
0005 pandi hyderabad
0006 santhosh hyderabad
0007 sasi salem
0008 kalai chennai
0009 suresh hyderabad
0010 vijay bangalore
0011 Arul chennai
0012 velu chennai
0013 khan bangalore
0014 praba chennai
0015 praba.p coimbatore
0016 anand ooty
0017 raja erode
0018 sankar erode
0019 vadivel namakkal
0020 anbu chennai
0021 Ajith mumabi
c)now i want to select the 'ENAME' field records starting
with 'S'
for that i have created a RPG program
its source code is
PGM
DCLF FILE(TAMIL1/EMPS)
DCL VAR(&MYENO) TYPE(*CHAR) LEN(4)
OVRDBF FILE(EMPS) SHARE(*YES)
OPNQRYF FILE((TAMIL1/EMPS)) QRYSLT('ENAME *EQ
%WLDCRD("S *")')
READ: RCVF RCDFMT(EMPRCD)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
CHGVAR VAR(&MYENO) VALUE(&ENO)
SNDUSRMSG MSG(&MYENO)
SNDUSRMSG MSG(&ENAME)
SNDUSRMSG MSG(&EADD)
GOTO READ
END: CLOF OPNID(EMPS)
DLTOVR FILE(EMPS)
ENDPGM
Is this coding correct sir,the program gets compiled,and if
i call it it says query running but records are not
displayed.please help me out
Answer Posted / roshan
the %WLDCRD keyword is case sensitive,
Your are entering the 'S' with capital latter in %WLDCRD
keyword and records present in file are start with
samll 's', becouse of that records are not selected in open
query command.
Thanks
Roshan
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
how do I declare a minor?
What are the types of identifiers?
When it is desirable to describe files Internally?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?
how can I tell when to replace the array?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
what is data area and how it is used in rpg program ?
if there is a module object , how to find the program object for this module object.Assume the module object name and program object name is not same.
give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........
can I touch the array during treatments?
what do you mean by an input subfile, what are the keywords required?
How can we override a file during runtime in rpg?
How to select highest score of each subject or how to select highest income of every month?
We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?