Thanks gagan for your answer,i'm new to as400,i don't know
embedded sql in rpg.can you send me the coding for the below
mentioned question in embedded sql rpg.
how to retrieve particular field records from a physical
file,say i have a physical file called 'employee' in it i
have to retrieve the records of a field 'admin' present in
pf 'employee' using rpg,but i should not use logical file
or openquery file.
Answers were Sorted based on User's Feedback
Answer / harshad r suryawaunshi
1. Declare cursor first - It will select all the record
available in the filed 'ADMIN'
c/exec sql
c+ declare cr1 cursor for
c+ select ADMIN from EMPLOYEE
c/end-exec
2. Open the cursor - its like seting the pointer on the
first record
c/exec sql
c+ open cr1
c/end-exec
3. Fetch the cursor - its like reading the records in the
cursor. NAME is the field defined in the program which
attributs are same as per field ADMIN.
c/exec sql
c+ fetch cr1 into :name
c/end-exec
This code u can execute in Do loop to read all the records.
The complete coding would look like this
c/exec sql
c+ fetch cr1 into :name
c/end-exec
C dow sqlcod <>100
C
C name dsply
c/exec sql
c+ fetch cr1 into :name
c/end-exec
C enddo
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ravi
Give DOW SQLCOD =0. There are several other errors with SQLCOD <> 0
| Is This Answer Correct ? | 0 Yes | 0 No |
we hav job which is running as batch. it takes atleast 06hours to complete tht job. bu i wana do tht job with in 3hours.........? so plz post ur answers
what is overlay? how can we pass parameters in cl or rpg programing? how can we get data area value in cl or rpg programming?
we are sending data of physical file to screen design and it is showing no record why?
how do I declare a table or array in rpg iv?
1.I have a Physical file with 100 records, No duplicates exists, all are Unique,But while i am running Runqry utility i am getting only 80 records..What could be the reason?
What does Implicit Open means with respect to a file ? What about the Explicit Open?..what are the major differences between these two?
1.How to load Records of a Physical file(PF) in the reverse order, in CL program?
Delete FileName at first statement in RPG.
Please help me, I have created window subfile,I have created Footer with same lengh and postion of window SFL. When I call the pgm, first is shows only Footer and then it shows subfile records.This time Footer is not showsing ..plz hel me how can i do it...? Sameple DDS and RPG: A R WIN1 SFL A*%%TS SD 20090130 165346 MUNSHIJ REL-V4R2M0 5769- PW1 A FLD001 1Y 0B 4 3EDTCDE (Z) A ATFILE R O 4 7REFFLD (QWHFDBAS/ATFILE LIB/LIBF- A ILE) A R WINCTL SFLCTL (WIN1) A*%%TS SD 20090202 123459 MUNSHIJ REL-V4R2M0 5769- PW1 A ALTNAME ('y') A SFLSIZ (0004) A SFLPAG (0004) A WINDOW (FOOTER) A ROLLUP (27) A ROLLDOWN (28) A CF12 (12 'Cancel') A 50 SFLDSP A N51 SFLDSPCTL A 51 SFLCLR A 1 2'Select Option,Press enter' A 2 3'1= Select' A R FOOTER A* A WINDOW(8 31 9 43) A 8 4'F12 = Cancel' A R DUMMY ASSUME A 24 10' ' in RPG: Dow *IN12 = *Off Write Footer Fxfmt WInCTL
1.I have a Batch job, Running for 4 hours, i want to reduce the executing time to 2 hours what should you do?
How do you call procedures in ILE?
Can anybody tell me in which scenario we have to use SQLRPG .(Embeded SQL)....?