Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS400 CLP,, parameters and lda

Status
Not open for further replies.

jmd0252

Programmer
May 15, 2003
667
Are there any cl gurus out there. I prompt thru cl for 2 dates,,, the load them into the LDA,, then change them via an RPG program to julian,,, but in order to use the %range paramter on a qryslt statement I have to reload the changed dates back into the 2 declared variables,,, so how do I do that??

 
Do not change the type of variable. Instead, declare two new variables for the dates as *DEC (6 0), like this:

[tt]DCL &RFDAT# *dec (6 0)
DCL &TFDAT# *dec (6 0)
[/tt]

Retrieve these new variables from the *LDA instead of the variables you are retrieving now. Then add two CHGVAR statements - something like this:

[tt]CHGVAR VAR(&RFDAT) VALUE(&RFDAT#)
CHGVAR VAR(&TFDAT) VALUE(&TFDAT#)
[/tt]

One question - why are you using the *LDA to begin with? And why are you using messages to interface with the user instead of a display file/program or a command interface?


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Originally I used the LDA to hold the dates after I changed them to julian in the previous program. Then had the second program check the data against the 2 dates, processing only the records that passed the IF statements. Well it works that way,,, but when the file you are processing is 4-5 million records,and growing,and you only have a 170 9406. It does take a while,, so I was trying to see if the opnqryf, could be of use to help the job to run quicker..

If this works,, I can throw it in the batch subsystem,, to see if that even runs quicker.
 
Well the last idea has at least got the job running,,, and the query is processing records,, I'll check the workfile to see about the records tomorroow,,

Thanks all,, Jim

 
Batch is almost always faster than interactive. Plus, most newer 400s have the interactive susbsystem limited. You should submit to batch whenever possible.

[tt]SBMJOB CMD(CALL PGM(MYPGM) PARM(&A &B)) JOB(myjob) JOBQ(QBATCH)[/tt]

Here is a link to the entire set of IBM manuals for V5R1. Keep it as a bookmark in your browser.





"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci
 
Well,,, we are still on 4.4 but going to 5.1, as soon as the CD's get her,, and my mistake,,, 7.3 million records,,, 285000 selected,,,
 
Glad you got it working. Sometimes it's hard to diagnose a problem like that - OPNQRYF can be tricky.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top