Storing HTML in a Physical File

470 pts.
Tags:
Database
DDS
HTML
PF
System i
Hello everyone, I'm looking for ideas for the best practice of storing HTML in a Physical File (PF). - A huge character field with VARLEN? - Some other data type available in DDS? Can't describe the PF with SQL (I'd like to, but need to use DDS). Thanks in advance! Dave

Software/Hardware used:
System I 7.1

Answer Wiki

Thanks. We'll let you know when a new response is added.

I have a similar function with similar restrictions (for those same reasons). Minimal benefit to being the pioneer who first implements a better process (I like learning new/better methods but tough to do when we’re SO busy).

I set up a PF to contain the results (html plus other fields used by the email creation routine that runs on the PC network). I used a large field size (multiple 512 char fields) and populate the content from a compile time table in the RPG pgms (so can use as many array elements as needed & concatinate to form full fields). This works well for my application because the html content rarely changes (when it does then it’s a program change).

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • andyhumphreys
    Shame you can't use SQL otherwise the LOB route might have been appealing. With DDS only, I think you're probably stuck with character VARLEN. Given that HTML can potentially introduce white-space, perhaps looking at writing an on-the-fly compression/decompression routine might help to reduce the space required? Depends really on exactly what you intend to do. There are some encryption/decryption routines written in ILERPG out there, based on the Qc3EncryptData/Qc3DecryptData APIs. These would by default compress everything down. And 7.1 I believe has built-in field encryption, but I haven't got much exposure to that?
    465 pointsBadges:
    report
  • TomLiotta
    Can't describe the PF with SQL Why not? It's almost certainly a better choice for this. (I'd like to, but need to use DDS). How could a "need" arise from this? How are you expecting ever to 'process' the HTML? Why would you want it in a database file rather than a normal streamfile? A general description of the overall issues could help a lot in coming up with useful suggestions. Tom
    125,585 pointsBadges:
    report
  • Dcantwell
    I can't use SQL to describe the tables because it's currently not used here. It's actually never been used yet. So, to keep in line with the standards that are established and make it available in our source control, I need to use DDS. Rules are rules. We're looking into allowing this in the future and make sure it fits. I've Here's what I'm trying to do: I'm creating a .NET program that uses the CKEditor (http://ckeditor.com/) to create HTML based emails that will be sent to customers. The HTML will eventually be processed in a back-end RPG program that places it in our email system. (I'm still looking into this one. May need to write a separate process that works with HTML based emails) Normal update, add, delete options would be needed. Are you thinking of keeping them stored on the IFS and manipulating them as files from there? I'm totally up for suggestions. We're using ASNA Visual RPG for the .NET programming. Just learning it now. Going to Texas in a few weeks for training. So, not really sure how to access the IFS from that yet. Sorry for such a long time in responding. This website's emails keep getting filtered. Thanks, Dave
    470 pointsBadges:
    report
  • TomLiotta
    I can’t use SQL to describe the tables because it’s currently not used here. It’s actually never been used yet. I'm making this next comment purely for completeness. I suspect that I understand totally the problem that you have with the site. But for completeness, are they aware that SQL is actually in use all over their system whether they have it in their in-house code or not? (It has been for years.) In any case, I wouldn't use a database table to store a HTML document. SQL and DDS wouldn't even come into it. Are you thinking of keeping them stored on the IFS and manipulating them as files from there? Definitely. That's what HTML files are; that's an example of what IFS streamfiles exist for. How often are HTML files stored in SQL Server databases or in any other DBMS? It's certainly true that it can be done and that there are reasons for doing it. But a path to a HTML file is practically the same as a key to an indexed table. The conceptual logic of management of them is essentially the same in that sense. And an IFS directory is much more easily shared out to a Windows network. Direct access by PC tools becomes trivial. And sooner or later, someone is going to want to "look" at some of the HTML in some way other than through RUNQRY or whatever might be used for a database file. The first program to read/write such a file can be tricky -- a little confusing at points. But once the first one exists, everything after gets easy. I wrote a CL subroutine at V5R4 that opened a Java properties file, read each line looking for a specific property, converted the CCSID of each line and wrote them to a new streamfile. The one specific property was modified so that it would be interpreted as 'minutes' instead of 'days' in the app. If it's reasonable in a CL subroutine, it's much more reasonable in a "real" language. Of course... SQL has been around since S/38 days. If SQL is too advanced, will streamfiles be allowed? (Serious question.) Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following