cpyf and cpysplf: How to copy spool files and database files in AS/400?

130 pts.
Tags:
AS/400 Spool Files
CPYF
CPYSPLF
Database Files
RPG
Hi,

Can you give me the what are the steps to copy the data from one pf to another pf using cpyf?

and how to copy the data from spool file to database file using cpysplf?

 



Software/Hardware used:
software

Answer Wiki

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

This seems to be a very basic question.
You need to look at the IBM manual for CL commands to get all the information
You specify the From file and the to file
You have options to add or replace records in the to file.
You can select only certain records ffrom the from file.
If you files are externally defined you need to see if the names match and what option of the FMTOPT parm to use.

Discuss This Question: 16  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
  • TomLiotta
    The steps will depend on what the definitions are of the two files. If the files share a record format, it will be different from files that have the same fields but ordered differently. And that will be different from copying between a "flat" file and an externally described database file. Show us the record formats of the two files and we can give you the steps. There are similar considerations for copying the text of a spooled printer file into a physical file. Tell us the line length of the spooled file and tell us how you want the line and page positioning handled. Then we can tell you how to copy the spooled file data. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Homework or Interview questions?
    49,720 pointsBadges:
    report
  • TomLiotta
    Probably, but if the OP can supply plausible context, it might not matter. For example, if two file descriptions show that one file has a format that is a logical subset of the other format, then it would be reasonable to describe the specific steps for that specific case. But I won't expect such a dialog to begin. Best might be just to ask in return about things that can make a difference. Students/interviewees shouldn't be discouraged (IMO!), but nor should they simply be handed answers that aren't earned. I don't know if ITKE provides a policy that can be referenced. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    These are, of course, lousy homework or interview questions but since we've posted answers they have lost any value they previously had. Do you want to hire this person? He/She has the grades and the answers but demonstrated that he/she didn't want to make even a little effort to solve his/her problems. This is very different from someone who has made the effort but doesn't grasp a bit of the question or answer. Phil
    49,720 pointsBadges:
    report
  • carlosdl
    This is from the "Ask a question" page: "Job postings, homework assignments and Advertising-based messages will be deleted." However, I've seen some flexibility regarding homework questions. I think it is a matter of common sense. Let's remember that one of the objectives of answering questions here (IMO) is to help others, and sometimes a correct answer to a homework question could produce the opposite result.
    69,065 pointsBadges:
    report
  • Michael Morisy
    Michael from ITKnowledgeExchange here. We try really hard to delete straight homework questions as quickly as possible, but if a member goes in and provides a quality, well-researched answer, we're inclined to let it stay (we get as many complaints about deleted answers as undeleted questions). #1 request from our end: If you see lame homework questions, click the "report question" under every question and let us know. We really appreciate the heads up and try and keep the site clean from lazy students. Thanks for discussing this issue, and let us know if you have suggestions on better handling it.
    8,323 pointsBadges:
    report
  • MelanieYarbrough
    Thanks to everyone for your feedback on this and other questions that you suspect are of the homework/interview variety. As you know, we do our best to weed out the questions that don't fall under enterprise IT, but there are definitely times when we give the benefit of the doubt in areas where we aren't sure. If you ever come across a question that meets our "will be deleted" criteria, please click the "Report Question!" button to the bottom right of the question box. We will be alerted to delete the question and you won't have wasted your time answering it. Hopefully this will keep any unsavory questions from seeping through without risking quality questions or discussion platforms from getting deleted in the crossfire. Thanks again for your feedback and patience! Melanie
    6,345 pointsBadges:
    report
  • TomLiotta
    ...if a member goes in and provides a quality, well-researched answer... If a 'student' chooses to engage in dialog and is obviously trying to learn, it's definitely different from "Here's a question. What's the answer?" It's pretty easy to tell when that's the case. Or if some answers are already given that might be incorrect, incomplete or misleading, then a more detailed answer seems appropriate because once the info is out, you can't know how far it's gone. The one who posted the earlier answer needs the info if no one else does. If an answer seems "incorrect, incomplete or misleading" to me, I'm going to want to dig in farther. There's always the possibility that I've been wrong and I need to learn what's correct. I'm happy to join a discussion in those cases. If a 'student' posts the work that has already been done and asks where the work is going wrong, it seems reasonable to give guidance on appropriate techniques. By posting their work, it's at least evidence of effort that was put out. This is from the “Ask a question” page: Where is the “Ask a question” page? Does it show up after I click
    125,585 pointsBadges:
    report
  • philpl1jb
    odd, I don't see a report question box. No, my issue isn't with the question so much as the patern of questions from the same person. His/her work spans 11 months and doesn't show any development. And that history doesn't include the question(s) that were actually deleted. Just copies one or two questions from the first chapter to take the lazy way out. That's the way it seems to me. Phil
    49,720 pointsBadges:
    report
  • TomLiotta
    ...the patern of questions from the same person. Agreed in this case. That's why my initial reply was as it was. Lack of response from the OP can be taken as unwillingness to learn. I don’t see a report question box. I see it immediately to the right of 'Add to Watchlist' under the question. Not that it helped much, since I didn't know this an appropriate use. Maybe it's explained on the 'Answer Page'! :-) ( Carlosdl?? ) Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    thanks Tom.
    49,720 pointsBadges:
    report
  • carlosdl
    Yes Tom, the "Ask a Question" page shows after you click on the "Ask a Question" link :-) How to get to the "Maybe it’s explained on the ‘Answer Page’!" I don't know of an 'Answer page', but the site FAQ (where's the site FAQ ?)) mentions something about reporting objectionable content. However, I couldn't find the “Report Objectionable Content” link mentioned there...
    report
  • Batman47
    You guys are way too sensitive.
    1,050 pointsBadges:
    report
  • philpl1jb
    too sensitive! "He grabbed the Kill-O-Zap gun and blasted a perfectly harmless accounting computer." Now that's too sensitive .. er, something. Phil
    49,720 pointsBadges:
    report
  • Splat
    There's no such thing as a 'perfectly harmless accounting computer'. Pure evil, those things.
    7,055 pointsBadges:
    report
  • TomLiotta
    You guys are way too sensitive. Which guys? To me, the areas and services that make up the total "site" are valuable. It's also valuable to the community as a whole. I try to contribute in order to increase the value. But there is necessarily a business model behind the "site". I can imagine what advertisers might see as the reputation of the site if it condoned supplying test answers to students or potential interviewees. I can imagine a slow drain of ethical professionals away from the site if we don't make an effort to behave professionally. Part of the definition of 'Professional' is the collective self monitoring. 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