|
The first time I tried this I couldn't get it to compile either. Consider the following RPG III example (C-specs removed): H F FQSYSPRT O F 132 OF PRINTER ** QSYSPRT DFF0EAF1EBF2EDF3EEF4EFF5FBF6FCF7FDF8FEF9 or the following RPG IV sample: H FTRANS(*SRC) F FQSYSPRT O F 132 PRINTER oflind(*inof) ** QSYSPRT DFF0EAF1EBF2EDF3EEF4EFF5FBF6FCF7FDF8FEF9 When you replace the program described printer file with an externally described printer file, you can't just replace QSYSPRT with REP1 in the file translation table. The following will not compile: REP1 DFF0EAF1EBF2EDF3EEF4EFF5FBF6FCF7FDF8FEF9 The file translation table data MUST start in position 9 in RPG III and in position 11 in RPG IV. REP1 DFF0EAF1EBF2EDF3EEF4EFF5FBF6FCF7FDF8FEF9 But you have a much larger problem than getting your program to compile. When you use a program described printer file, all of the data in the O-specs are treated as if they were character data in the output buffer. But when you use an externally described file, you are going to get a CPF5075 "Changed field is not a correct zoned decimal number" error because you are attempting to put invalid data in a numeric field. E.g., X'DF' is not a valid numeric character. One way to circumvent this problem is to define ALL of your numeric fields in the externally described printer file as CHARACTER fields. Then set the character field to the numeric value in the RPG program. The character field will be translated without an error. If you use RPG IV, you can do this VERY easily. eval charfield = %editc(numfield:'L') where 'L' is the edit code you want to use enclosed in single quotes. There may be a better way to do this. But this is the best I could come up with quickly. Charles L.Massoglia, President Massoglia Technical Consulting, Inc. cmassoglia@voyager.net In MI 517-676-9700 or in NC 919-363-9395 ----- Original Message ----- From: "bakrudeen ali ahmed" <bakrudeena@rediffmail.com> To: <rpg400-l@midrange.com> Sent: Monday, 18 February, 2002 05:54 Subject: File Translation from English to Arabic > > Hi All, > > I was on a process of Converting Internally Described Files to Externally Described. There I was trying to use externally described Printer file instead of "QSYSPRT". > > In a Program, they are converting all the english numeric to Arabic numeric, by adding a simple code in Internally described file using QSYSPRT. > The code they have added is in array format. > QSYSPRT DFF0EAF1EBF2EDF3EEF4EFF5FBF6FCF7FDF8FEF9 > > Like the above they have added it in array format by keeping "**" at the end of the program. But they have specified only File translation "F", in the internally described file. > When I do the above process, automatically all the English numeric are converted to Arabic numeric. > > Here is my question. When I was using externally described printer file (For eg "REP1") > And instead of QSYSPRT, I changed it as REP1 in the above format, but it is not compiling. > > Please give me assistance on it. > > Thanks > Bakrudeen > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > 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.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.