Do the event logs show anything useful? What is the time range the systems seem to stay connected in? — Tom
Since SETLL and READE don’t make sense to use for this, and since you are restricted from using SQL as a solution, it seems very much like an academic assignment. You need to show the code you have worked out first, then we can possibly comment on your code. We can’t provide code for you. — Tom
Debug . . . . F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable F12=Resume F17=Watch variable F18=Work with watch F24=More keys BIG-NBR = 0000000000000000000000052.0000000000000000000000000
PROCESS APOST NOPRTCORR
DATE
TIME
TIMESTAMP
CVTTODATE
VARCHAR
Identification Division.
Program-ID. TST2 .
.
Environment Division.
Configuration Section.
Source-computer. IBM-AS400.
Object-computer. IBM-AS400.
.
Data Division.
File Section.
.
Working-storage Section.
.
EXEC SQL
INCLUDE SQLCA
END-EXEC.
.
77 big-nbr pic s9(25)v9(25) comp-3.
.
01 HOST-VARS.
05 iCnt pic s9(18) binary.
05 iTot pic s9(5) comp.
05 minFile pic x(10).
05 maxFile pic x(10).
.
Procedure Division.
.
00-Main-driver.
.
EXEC SQL
SELECT COUNT(*), SUM(APNKYF), MIN(APFILE), MAX(APFILE)
INTO :HOST-VARS
FROM ACCPTH
END-EXEC.
.
compute big-nbr = iCnt
.
goback.
.
00-Main-driver-exit. exit.
i agreed with you, but i have to do without using sql. Only loops and flags and setll and read.
You could use SETLL and READE, but it doesn’t make much sense. Those don’t fit the problem well at all. The simplest is probably just to run a basic SQL statement:
insert into FILEB
select
A, max(B), max(C)
from FILEA
where C ='Y'
group by A
order by A
It depends on how the program runs. Does the program have a display file it will display the message in? If not, how is it expecting any control over what messages display at all, much less where they display or what the format will be?
.
There are multiple options. Maybe the best option to start with is not to use CPYF for this. If you are copying source file members, consider using CPYSRCF instead. The intention is clearer.
.
Tom
Maybe you should try to find out the difference between maximum size and maximum precision.
data is like this:
10 1 N
11 1 Y
11 2 Y *
13 1 N
14 1 N
14 2 Y
14 3 Y *
15 1 Y *
Please describe the context. The only “EHR” I can think of would be Electronic Health Records, but there is no “HER” that seems related to it. — Tom
You would use SQL statements to access SQL data. Are you trying to learn SQL? Or do you have a specific business problem you need to solve? — Tom
We can suggest schools that teach fundamentals. Where are you located? There are also on-line schools and tutorials if necessary. — Tom
It doesn’t seem to be academic, since both members have submitted a series of questions that all seemed valid. But they are certainly the “same” question, so they shouldn’t be handled separately.
.
I can think of two general possibilities. The first would be an interview problem with various applicants working up solutions. The other possibility can be explained by the OP.
.
Please describe the business problem that this will solve.
.
Tom
The file has create timestamp. Are you auditing for *CREATE events? Does the audit journal help point to the creation program? Is the “higher” library a SQL collection or a normal library? Is it directly related to the user ID? (It doesn’t seem like it would be from your description.) Was all work done in STRSQL? — Tom
Meant chgusrprf since its in a prgram then use a variable
If all the data is in one spreadsheet, get that to a file on the AS400.
Declasre the file in your CL (DCLF)
Use RCVF to read the records from your file.
Use CHGUSRPF to adjust the values to waht is in the file.
Make sure the program is run by a USRPRF that has the authority required to make the changes.
Sounds like a homework question… I saw another post asking for same info…
Show us what you tried and we can point you in the right direction.
Please note, I do not and have never worked for Microsoft. Just curious about your opinions on Azure.
yeah, I thought of that, but his session is still set fro the default QGPL/QSQLSELECT and that output redirection only works for select statements; updates, etc run as they are supposed to
thanks for any suggestions though…
Very unlikely but it’s about the only way I can think of ..
.. Interactive sql .. change session attributes .. Select output .. 3.. to a file
.. system holds these values from previous session.
Output file ..must be specified .. library must be specified .. then select will create duplicate file based on selection rules.
Phil







