how to access QTEMP files in batch programs.

695 pts.
Tags:
CL batch program
QTEMP
RPG
RPG ILE
Hi All, I have developed one tool in AS400 which consists of one CL program and one RPGLE program. I have created 2 temporary files in QTEMP in CL program. RPG program is called by CL. these two files will be used in RPG program in update and output mode. after that i want to run that RPGILE program in batch so i issued SBMJOB command it gave me error that files are not found(files which were created in qtemp) can any one please tell me how can i access QTEMP files in batch programs.

Answer Wiki

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

Hi

actually u have done the sbmjob so it will have its own Qtemp library and from where it is trying to find out those two files.
what you can do is while in CL where you are creating these files in qtemp….u can copy it to some development library … which should be in the library list ….

Hope this will help you..

Regards
Reshma

Discuss This Question: 9  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
  • Mohan K
    Hi Reshma, I understood the explination you gave above, however i dont want those two files to be exist in any of the library once the program excution completes. And one more thing is i have developed this program for one tool, so now i am going to distribute this tool to other engagements in our company who are using AS400 technology. so i am not sure about what will be the default library list of other engagements. shall i copy those 2 files to QGPL library ? can BATCH process access QGPL library ? Regards, Mohan K
    695 pointsBadges:
    report
  • Cwc
    If you're building the QTEMP files in your CL program before calling the the RPG program (also from your CL), then they will be accessible for the duration of the job, whether it's an interactive job or batch. So, when you submitted the job, did you submit the call to the CL or to the RPG program? If you called the RPG in your submit command, that would explain why it couldn't find the QTEMP files since the submitted job has its own QTEMP library. So, call the CL program in your submit job command and it should work.
    4,290 pointsBadges:
    report
  • Joy Stalnecker
    The easiest answer to me would be sumbit the entire process to batch from the begining so that when the files are created in QTEMP they are available for the entire process. I didn't see any mention of why this could not be done.
    170 pointsBadges:
    report
  • PGMBOB
    Hi, Our friends have provided good suggestions. You do not want to add your files to qgpl. You want these files to go away whwn the job ends. Each job (new job number) is given an independant separate library named QTEMP. Understand that the job you submit WILL NOT have the QTEMP where you created your files. Any file overrides you had do not exist in the new submit job either. Submit you CL, Allow your CL to create the files in QTEMP of the submitted job. The files are now available to the RPG process you call from the CL IN THE SUBMITTED JOB. You might not know where QTEMP position in the library list. of the submitted job. Make sure your file names are UNIQUE enough so it is unlikly that the SAME file name (not yours) is in the library list. Don't use MASTER or ADDRESS. You might want to override spcifically to the files you created. . Do you need to have the files with data before submitting the job? You might want to create a LIBRARY that you include in the submit job command.. Create a unique named library like MO$KNNNNNN where NNNNNN = JOBNBR Get the infomation from the user for the files you are creating and want to process in batch. Include the LIBRARY you created in the BATCH job submit command. Delete the unique library you created when your batch job completed. Remember Qtemp is unique to each JOB. Good Luck! PGMBOB
    990 pointsBadges:
    report
  • Mohan K
    Thanks to all of you for your valuable suggestions.
    695 pointsBadges:
    report
  • WoodEngineer
    Our IBM business partner strongly recommends that we not put any user files in QGPL. He said they could easily get lost when installing a new version of the operating system. Tip: use this system value if you want to be sure QTEMP is always in your library list and near the top of the list. Display System Value System value . . . . . : QUSRLIBL Description . . . . . : User part of the library list Sequence number Library 0 10 QGPL 20 QTEMP 30 QFAX
    6,365 pointsBadges:
    report
  • Teandy
    <quote> Our IBM business partner strongly recommends that we not put any user files in QGPL. He said they could easily get lost when installing a new version of the operating system. </quote> Maybe I have just been lucky but I have been putting user files in QGPL since I started on the AS/400 almost 20 years ago and have never had a problem during an OS upgrade.
    5,860 pointsBadges:
    report
  • Splat
    It's better for transient data to create a multi-member file in your production library & add and remove the members. It cuts down the overhead of creating a new object every time the job(s) run, the data is discrete, and you can use the members interactively and in batch (just pass the member name as a parameter in your SBMJOB). With the F-spec EXTMBR keyword now available, you don't even need to bother with using the OVRDBF command to identify the member in question.
    6,895 pointsBadges:
    report
  • TomLiotta
    Maybe I have just been lucky but I have been putting user files in QGPL since I started on the AS/400 almost 20 years ago and have never had a problem during an OS upgrade. As with any library, problems can happen during upgrades or any other time. I would expect QGPL to be slightly more vulnerable simply because it can be explicitly reference during OS upgrades. However, my experience is the same -- I can't recall a single problem with user objects in QGPL in over 20 years. Nor have any of our many customers ever reported a problem. IBM is very careful about handling user objects in QGPL. It is, after all, classified by IBM as a 'user' library. They'd be in plenty of trouble if they changed that now. Plenty of ISVs would be all over them. As for sharing interactive and batch QTEMP, it's not a reasonable request even if IBM-approved methods allowed it. There is no guarantee that an interactive QTEMP will still exist by the time the batch job starts. A member in a physical file in a known library could be a reasonable solution. Even uniquely identified rows in a single-member file might work. Or add uniquely keyed entries to a user index or even a data queue; don't use a file at all. 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