× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2/10/2014 9:27 AM, Don Cavaiani wrote:
Strange question here. I have a older DOS PC football game with a 'stats' file with an .lgs extension. This file has each teams several offensive and defensive 'ratings' in a 1 to 9 format. I have created a spreadsheet which I can get up to the IBM i. The sheet has each team's various 'UPDATED' stats in columns across the team row. I want to get the PC file to the IBMi in an understandable format, then write an RPG program to access it and change each of those stats according to the excel uploaded file, and then RETURN the file to the PC so the game may be played again. I know finding the PC file record length is an issue, and understanding the PC file layout is confusing at best, not to mention how it 'converts' when uploaded to the IBMi.

I'd start by opening the .lgs file up with a programmer's editor, like
Notepad++. Something that you can use to look at the guts of the file
on the PC.

Once you understand the file layout, consider putting it up on the IFS
rather than trying to convert it to a DB2 file. You can use Scott
Klement's IFS APIs to read the .lgs file directly, then write a new,
updated .lgs file.

As for the spreadsheet, that might work better for you if you convert
that to a DB2 file so you can CHAIN / exec sql FETCH from it more
readily. Look at EZ400's XLSTABLE command for a conversion utility
that'll do that.

1) .lgs file to /home/donc/old.lgs
2) spreadsheet to /home/donc/football.xls
3) XLSTABLE to get spreadsheet to DB2 DONC/FOOTBALL
4) RPG program
a) read old.lgs
b) CHAIN FOOTBALL
c) calculate new rating
d) write new.lgs
5) .lgs file from /home/donc/new.lgs

Hope this spurs some ideas.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.