Q
Problem solve Get help with specific problems with your technologies, process and projects.

Creating files within an RPG source code

How can I create a Physical File and Logical File within an RPG source code (via SEU) is it possible?
Do you mean you want to create the source code 'on-the-fly' using your RPG program? You would do that if the fields or keys were not known in advance of running the program. That would be very unusual, but can be done easily enough. Just use QCMDEXC to create the source member (you could create the source file in QTEMP or use one that already exists), then again to override to the output file in your program. This file would be program-described with a record length of 92 bytes, unkeyed. The record structure is:

 
6,2S SRCSEQ        Source sequence number 
6,0S SRCDAT        Source change date 
 80A SRCDTA        Source data  

Write your source lines, making sure to increment the sequence number. Close the file, delete the override and execute CRTPF or CRTLF using QCMDEXC.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was last published in April 2005

Dig Deeper on RPG iSeries programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...

Close