How do you code file / field renames in ILE RPG?

Answers were Sorted based on User's Feedback



How do you code file / field renames in ILE RPG?..

Answer / kcsyam

Define a Data Structure in ILE RPG.

D New_File E DS EXTNAME(Old_File)
D New_Field1 E EXTFLD(Old_Fld1)
D New_Field2 E EXTFLD(Old_Fld2)

You can use PREFIX keyword instead of EXTFLD on different
way

Is This Answer Correct ?    20 Yes 1 No

How do you code file / field renames in ILE RPG?..

Answer / ankit10

To rename a field we use prefix keyword.

Is This Answer Correct ?    1 Yes 0 No

How do you code file / field renames in ILE RPG?..

Answer / ravikumar895

Hi Ankit and shivam,

if two files having same record formats, using RENAME keyword we can rename the one record format...

Ffilename1 UF A E K Disk
F Rename(original record format name1:new record format1)
Ffilename2 UF A E K Disk
F Rename(original record format name1:new record format2)


Answer for Harshad to his question :
--------------------------------------------

D D0220NEW E DS PREFIX(D21:3)
D EXTNAME(CZGD02H0:CZTD02H2)
D D0220OLD E DS PREFIX(D@@:3)
D EXTNAME(CZGD02H0:CZTD02H2)

Is This Answer Correct ?    0 Yes 0 No

How do you code file / field renames in ILE RPG?..

Answer / shivam

use remane opcode

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More RPG400 Interview Questions

in which journalling which attributes are necessary

2 Answers   CTS,


what is the necessary keyword needed to scroll subfile records?

0 Answers   IBM,


suppose a job is running for 15 minutes after that it goes to message wait? what are the impact analysis

1 Answers  


I have a file .In that file i have 3 fields. Those fields are eno, ename, esal.Keyfield is eno. In that file i have data like this for eno 1,2,3,4,5. Now i need to display 2nd record. That means i need to set the pointer on 2nd record... Then, write the complete rpg program using setll.

1 Answers  


Q:HI friends accually ihave one problem plesase let me know the alternate code of this code. Related field description of code: Add a field, CALvsPRD, "Calendar Day Starts Before/After Production Day" to the parameter set WRKORDER which accepts values 'A' or 'B' o B = Calendar Day Starts Before Production Day o A = Calendar Day Starts After Production Day o Any other value indicates the production and calendar dates are always the same. code: Automatic Execution Of *INZSR Subroutine /Z01 * retrieves WRKORDER field values. /Z01 * Calculate default Production Date and return it to caller. /Z01 * Production date defaults to system date /Z01 C Eval P@Pdate = %DATE() /Z01 * unless Calendar date starts Before PDN(production) date and /Z01 * system time is before PDN Start Time then /Z01 * PDN date is yesterday. /Z01 C If W@CALvsPRD = 'B' and /Z01 C %TIME() < %TIME (W@Strtime) /Z01 C Eval P@Pdate -= %Day(1) /Z01 * unless Calendar date starts After PDN date and /Z01 * system time is *GE PDN(production) Start Time then /Z01 * PDN date is tomorrow. /Z01 C ElseIf W@CALvsPRD = 'A' and W@Strtime > *Zero and /Z01 C %TIME() >= %TIME (W@STrtime) /Z01 C Eval P@Pdate += %Day(1) /Z01 C EndIf /Z01 C Eval *InLr = *On

0 Answers   IBM,






what is file identifier wher we can use

1 Answers   IBM,


Can a indexed file be accessed in arrival sequence in RPG?

1 Answers  


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  


I have two sessions S1 & S2 under this 3 jobs(say j1,j2,j3 under session S1) And 2 jobs(Say j4, j5 Under session S2)is running. How many QTEMP & how many LDA will create for the same.

9 Answers   IBM,


1.Are there any errors in the following statement?If so then list them.DTAARA is a data area having a field EMP # and EMPNO is a field in the file EMPPF.Which has one record. READ EMPPF IF %FOUND(EMPPF) IN DTAARA EVAL EMP#=EMPNO OUT DTAARA ENDIF

5 Answers  


what is the necessary command needed before OPNQRYF and why?

5 Answers  


How to update selected fields from pf without using update opcode. How to read all member in Rpg-3,without using any cl command?

8 Answers  


Categories