phil code given by ravula will half justify of condition.
i have to satisfy the C=’y’ as well as write the latest records. which i mentioned as *.
100 Ist record (grp 1)
101 2nd record(grp2)
101 3rd record(grp2)
101 4th record(grp2)
102 …
102 …
103 ..
104 8th record(grp5)
Suppose I have to traverse the whole pf having data as above.
I need to traverse each set of key perform some action specifically n then traverse further set of
Key. According to my knowledge of setll and reade commands. I will do like this…
Suppose key=101
Setll key filea
If %equal
Dow not %eof
Reade key filea
………
………
Condition;
Enddo
Write fileb
Endif
In this way I can traverse the one group , but how do I change the key to point the another set of keys.
As i told u i am new to rpg..
might be answering to the above question can solve my previous problem…
Is this a homework question?
If not, can you show us what you have done so far and explaining exactly what problem you are experiencing?
Is this a homework question?
If not, can you show us what you have done so far and explaining exactly what problem you are experiencing?
“ravula i already applied the same code before”
Ravula’s code followed my logic and met your spec.
It wrote the records to file B
only for rows with C if VAL=’Y*’
The command c write format2 writes the records
print the latest records — PRINT?
you said write them to the file B.
Do you want to PRINT them to a spool file
or Write them to a file
or both.
Phil
A classroom has a teacher computer, smartboard, projector, video splitter, audio amplification system for the teacher, dvd player, and an AppleTV. All of the video components can be displayed using one or more of the video inputs on the projector. All of the audio components play through the audio amplification systems speakers.Please draw a diagram showing how you would interconnect the components and what cables you would use to interconnect them. If you can come up with a solution that makes the video splitter unnecessary, then feel free to not include it.
… In the discrete conversion each step could be monitored separately so that we would know which date was invalid…
that’s true philpl1jb, if it was important to know which one was in error, I would have to either determine it in the monitor or do a dump(a) to get a listing of them all or something
Please ignore that sndpgmmsg D-spec. Left over from various experimenting and not used in current version.
Tom – This is basically the first pgm here to use this technique for a msg subfile. I grabbed the parm info from something that calls the api but doesn’t seem fully functional. Since it sometimes works, I assumed the parms are OK.
Here’s the detail on it …
Parm fields –
D msgId s 7A
D msgLoc s 20A inz(‘SHMSGF *LIBL ‘)
D msgType s 10A inz(‘*DIAG’)
D msgKey s 4A inz(‘ ‘)
D msgErr s 4B 0 inz(0)
D msgrmv s 10A inz(‘*ALL’)
D msgData s 256A inz(‘General Error’)
D msgDlngth s 10i 0 inz(0)
D msgCStk s 10a inz(‘*’)
D msgCStkcnt s 10i 0 inz(0)
D sndpgmmsg pr extpgm(‘QMHSNDPM’)
api call –
C MSFSnd Begsr
C Eval msgDlngth = %len(%trim(msgdata))
c Call ‘QMHSNDPM’
c Parm msgId
c Parm msgLoc
c Parm msgData
c Parm msgDlngth
c Parm msgType
c Parm msgCStk
c Parm msgCStkcnt
c Parm msgKey
c Parm msgErr
C Endsr
The message file is standard. The screen setup is exactly what I’ve used many times (elsewhere).
Bruce – I’ll send you the whole thing via email.
What type of data are you looking to store and retrieve and for how long? Why not use cache, is there a reason? What language are you using? You may be able to use global variables, cookies or other means. A little more info on what you are trying to do would help in coming up with a solution.
i am not a student , i am it professional.. as400 and rpg is new to me..thats why facing such kind of problem.
ravula and phil thanks..
ravula i already applied the same code before… it wont solve my problem..because i have to print the latest records means the record which i hv marked as *.
The library was not specified in the update. The file shows it was created by the user that ran the update query, and as far as we can tell from the job log, it was right around the time that he was running the update that the file was created. It was run in the STRSQL interface, and no one else was running a query on the file, but the other users may have been running applications using various records (he did not have an exclusive lock on it)
We haven’t been able to repeat it, but that doesn’t exactly give us a “warm fuzzy”:(
thanks everyone.. but i tired a lot, thats learning assigment ur rite… but i am unable do so..
i ll send u my code i tired than please correct it whether i am rite or wrong while using setll and reade.
Did the file to be updated by the SQL statement have the library “qualified”? I’d like to know so I can try a few tests myself.. Scary problem if it can be replicated.
Any chance somebody else was running the same update at the same time? I know you checked the file for a create date/time, how about the user ?
To start with, how are the parameters specified? Through a DSPF, passed parameters or hard coded? If you have a DSPF just add an error message field to the DSPF an then MONMSG and send that to your ” CPY ERROR MESSAGE”.
If there is no user interface, how do you envision displaying an error message? Lastly, as Tom mentioned is this a “source” file or a data file ??
An idea hit me … what if it’s not ‘dropping off’ but the DNS TTL expires? I’m certainly no expert on DNS, but maybe the problem is that – since it’s not logged into the domain, could the DNS record on the server(s) expire? This gave me the start of the thought process: http://support.microsoft.com/kb/318803
ravula
That’s very impressive but it was a homework problem ..we try to help people learn, not do homework for them! There is no learning in copying.
Phil
============IPF01
A R FORMAT1
A NUM 3S 0
A SIGN 1S 0
A VAL 3A
A K VAL
===========IPF02
A R FORMAT2
A NUM2 3S 0
A SIGN2 1S 0
A VAL2 3A
A K VAL2
here these are the files which i used , data which you have given i have inserted into ipf01 and after executing the program , it inserts the data you wish into ipf02
hello please try the above code it moay works for you.
thanks,
satya







