No need to go through all of the gyrations. Just use the Rename( ) keyword
on the file statement. This renames the record format. If you need the
record format name, use the renamed version.
Jerry C. Adams
IBM i Programmer/Analyst
Line up alphabetically by height. - Casey Stengel
--
A&K Wholesale
Murfreesboro, TN
615-867-5070
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Dunk, Michael - Bognor
Sent: Friday, April 20, 2012 9:48 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: Is there a single CL command to change record format name?
Creating a file named DIBDWF3 with an AS/400 query, to be read in RPG was
causing QRG2122.
Looking at a similar program written some time ago by someone else, the
query file read by RPG had a different record format name.
Using Google I found two links:
http://search400.techtarget.com/tip/Changing-existing-physical-files-record-
format wasn't something I could do in a CL program
The following article leads me to wonder if there isn't a command to change
a record format name.
http://www.mcpressonline.com/tips-techniques/sql/techtip-sql-and-i5os-record
-format-names.html
The only way I could find to solve this, was to use RNMOBJ to rename the
file. Then the record and file name have different names, a similar to the
above article. Do you know if there is a simple way to change a record
format name?
The compilation error in the RPG program attempting to read the file was:
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.
...8....+....9....+....0....+....1....+..
H
*****
300 FDIBDWF3 IF E DISK
20/04/12
400 * Query file
19/04/12 S
* 2122 300 RECORD NAME DIBDWF3 PREVIOUSLY DEFINED AS FILE NAME.
RECORD FORMAT(S): LIBRARY MY_LIB FILE DIBDWF3.
EXTERNAL FORMAT DIBDWF3 DROPPED DUE TO ERROR OR IGNORE.
Best regards,
Mike
----------------------------------------------------------------------------
--------------------------------
John Wiley & Sons Limited is a private limited company registered in England
with registered number 641132.
Registered office address: The Atrium, Southern Gate, Chichester, West
Sussex, United Kingdom. PO19 8SQ.
----------------------------------------------------------------------------
--------------------------------
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.