Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how we retrieve records without using key field (ex:name)
from Physical File through RPG in as/400?

Answers were Sorted based on User's Feedback



how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / kumar vikas

Ffile1 I F E DISK (no keyfield is given)
C
C *start setll file1
OR
C 1 setll file1
C
C read file1
C dow not %eof
C id dsply
C name dsply
C read file1
C enddo

Is This Answer Correct ?    15 Yes 1 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / ttom

Read the file till EOF and check field values using a
condition in a the loop.

Is This Answer Correct ?    3 Yes 2 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / anand

but atleast there should be a keyfield to perform setll right ?

Is This Answer Correct ?    5 Yes 5 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / sujit kumar biswal.

Witout key u can use either SETGT or SETLL.And witought key
these two opcodes work only folloing conditions.
1.U can spesify any sequence no in factor1
2.Also *hival is work with it.
3.Field name work but only for intiger.

so code ur programe as answer4,but just change the *loval
to any sequence no or *hival then readp or any int field
one ex.
F PF/LFNAME IF E DISK

C *HIVAL SETLL RECORDFORMATNAME/PROG.NAME
C DOW %EOF
C READP RECORDFORMATNAME/PROG.NAME
C FIELDNAME1 DSPLY
C FIELDNAME DSPLY
C ENDDO
C EVAL *INLR=*ON

Is This Answer Correct ?    0 Yes 0 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / ak

use chain and put factr1=rrn number (line number)
and u hit the dirct

Is This Answer Correct ?    1 Yes 1 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / gk

We can read the records from the file directly without any
key field.

*LOVAL SETLL XXXX
READ XXXX
Put it in the DO loop and check for the EOF.

Hope you have got the answer.

Is This Answer Correct ?    9 Yes 11 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / ld123q44

The question is how you retrieve records from externally
defined files without using a key.

You can do this by designating the file as a primary file in
the program.

Is This Answer Correct ?    0 Yes 4 No

how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?..

Answer / syam

Yes, You can retrieve records from External Physical File
with key.

1.Specify PF as a program described file in RPG Program.
FFilNam IF F 80 6AIDISK KEYLOC(7)

(80=Record Lenght, 6=Key Lenght, (7)=Key starting
position)
2. IFilNam KD 01 1 C0 2 C1
I 7 12 NAME
(KD=Sequence,01=Record Id,1&2=Starting position,C=Any
Character,0=Value. Means In my file each record is having 1
and 2 posion = 01 to identify record, 7 to 12 =Name)
3.C MOVE 'SYAM' NAME
C 'SYAM' CHAIN FilNam
C N41 MOVEL NAME CUSNME
C 41 MOVEL *BLANK CUSNME

Try this code.

Is This Answer Correct ?    4 Yes 10 No

Post New Answer

More RPG400 Interview Questions

Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


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.

0 Answers  


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...

0 Answers  


How to declare the more than one file in cl/400.

13 Answers   IBM,


What is Multi Occurrence Data Structure(MODS)?

1 Answers   CTS,


1.How you will find the program is batch or online in cl pgm? 2.How you will end the batch pgm when the job runs? write an logic? 3.In wich command the option *drop is used?

2 Answers   TCS,


what procedure should we use to find whether the following operations are successful or not setll setgt chain read reade readp pls tell with example i'm not lazy to read the manual or not lazy to do anything.but sometimes i cannot understand the things given in manual in high level english its little bit complicated for me,i can't understand their way of writing thats why i ask these questions here and find the solution in simple words that i can understand thats the real reason sir.sorry if i had hurt you or disturbed you.please understand my situation.

5 Answers   iGate,


what is program status data structure?

1 Answers   IBM,


program to find the number of objects used in a given program through a display.

2 Answers   IBM,


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

1 Answers  


How to declare the dynamic(run time) array in rpgle? can you please give example

2 Answers   Polaris,


i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it will return?

6 Answers   Mind Tree,


Categories