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 I can reread the physical file in CL program once the
end of file reached in same CL program.

Answers were Sorted based on User's Feedback



How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / naga srinivas.kattula

Why u need POSDBF? whether u are checking the record in
first file is in second file?

Is This Answer Correct ?    1 Yes 1 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / ravikumar

Hi,

we can read this file from end of file now.

but once the cursor reached at the end of file then we can not read it again.



DCLF FILE(FILE NAME) OPNID(E)

POSDBF OPNID(File Name) POSITION(*END)

READ: RCVF OPNID(E)

MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

OPERATIONS

GOTO CMDLBL(READ)

END: ENDPGM

Is This Answer Correct ?    0 Yes 0 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / tthomas

Once the file reaches EOF the file is close.POSDBF wont
work in this case. To be clear no file operations can be
done on the file.

Upto 5 files can be declared in V5R3 with different OPEN
ID's.So u can declare the same file 5 times if u want and
perform different operations until the file reaches EOF.

Hope this info will be sufficient.

Is This Answer Correct ?    4 Yes 5 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / sekhar

In V5R4M0 , we can declare 5 files in CL-ILE pgm

DCLF (FILE1) OPENID(OP1_)
DCLF (FILE2) OPENID(OP2_)
DCLF (FILE3) OPENID(OP3_)
DCLF (FILE4) OPENID(OP4_)
DCLF (FILE5) OPENID(OP5_)

DCL &LGL *LGL VALUE('1')

DOWHILE (&LGL = '1')

RCVF (RCDFMT_FILE1)

MONMSG MSGID(CPF0864) EXEC(LEAVE)

OPERATIONS

ENDDO

SIMILAR TO ALL 4 FILES....

Is This Answer Correct ?    4 Yes 5 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / jp

Answer no. #11 is correct. Thanks Abhishek. NOthing else
works.

Is This Answer Correct ?    0 Yes 1 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / abhishek bajpai

Hi All,

Please read the question first. It asks the method to re-
position/re-read the file again after it reached EOF in a
CL. Please dont post answers to prevent it from reaching
EOF :).
Also, u can use a single keyword CLOSE for the same as
described above by me.
Thanks

Is This Answer Correct ?    0 Yes 1 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / mathi

The PF must be opended using OPNDBF or OPNQRYF in CL. Then
using POSDBF OPNID(Filename) POSITION(*START) command we
can make the cursor to point to begining of the file.

Is This Answer Correct ?    3 Yes 10 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / siddhartha

Use POSDBF OPNID(File Name) POSITION(*START) to position
the cursor to the beginning of the file.

Is This Answer Correct ?    11 Yes 20 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / sekhar

PGM
DCLF FILE(FILENAME)
READ: RCVF RCDFMT(RECORDFORMAT)

MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
OPERATIONS
GOTO CMDLBL(READ)
END: ENDPGM

Is This Answer Correct ?    10 Yes 20 No

How I can reread the physical file in CL program once the end of file reached in same CL program...

Answer / skma

I think it can be done by using OVRDBF
Like
OVRDBF FILE(FILE1) POSITION(*START)

Thanks

Is This Answer Correct ?    1 Yes 12 No

Post New Answer

More RPG400 Interview Questions

Why we cannot call a service program? If I add a PEP can i call the service program?

1 Answers   DELL,


Difference between RESET and CLEAR

1 Answers   TCS,


Im traying to get out put of this below mention simple logic code.But im geting out of different.(im trying with my laptop trhough my company server. DCL &FIELD1 *CHAR 10 VALUE('TCS AS/400') DCL &FIELD2 *CHAR 10 CHGVAR(%SST(&FIELD2 1 10))(%SST(&FIELD1 10 1) Can you tell me the value of field2 after excuted of CHGVAR command.

2 Answers  


Suppose in CL we reach at end of file and again we have to reach from 1 record

3 Answers   TCS,


Job is in MSGW while reading the input file and writing a new record / updating a reacod due to Duplicate data error. What action would you take ( C D I R )...?

4 Answers  


How can we change element of compile time array?Can we do so

1 Answers   TCS,


How Commitment and Roll back control is used in as400, explain with real time senario ???

2 Answers   Acolite, HSBC,


IN RLU what are the record level keyword is used?

5 Answers   iGate, TCS,


what is decimal data error? when it will come and how to achieve(rectify) this error please give me solution as well as code

2 Answers   IBM,


A pgm subroutine calling child subroutine, that child subroutine again calling parent subroutine, u have 1000 lines of code, with out debugging , how can u find that error??? Is there any command to find errors in pgm???

3 Answers   HSBC,


Q1.How we can copy the data of file one session to another session? Q2.how we can execute a loop infinitely in AS/400 coding? Q3.In ALDON tool,multitask is posible on a perticular object by the user?

6 Answers   CSC,


what is the difference between the cpyf command crtdupobj command?

9 Answers   IBM,


Categories