Beruflich Dokumente
Kultur Dokumente
I have a situation where there is a pf file which was the output of a Wrkqry. Now there are
hundreds of wrkqry in the library, how to identify which wrkqry created this file?
DSPFD/WRKOBJ is not helpful in this situation as they cannot give the wrkqry which created
this file. Please help.
Ans:
When you create outfile you specify *OUTFILE in the command, there you specify
the name of out file, so that is the only place from where you can know what is the
outfile for this query.
If you want something which tell you automatically, you need to program it, and
store history in a file programatically and the from that data which query and which
outfile.
Ans2:
Try this
It gives spool file. Then dump that spool file into flat file.
Then Read that file and find the position of object name.
I think this will help you. But you have to work hard on the logic part.
Task:
Automate the auto reply (with "I" - ignore), on particular job when there is a message wait.
Ans:
In rpg program if we are using qprint and if there is requirement to change the field value with
respect to length of this report then how we can change it
Ans:
First change the length of field, then adjust the positioning of fields appearing after
this field, if that length is more than report width, then take option 19 from
WRKMBRPDM to change the report width, and then recompile the PRTF, then
recompile the program......done.
hi neeraj! i have generated a report in spool file and i have to mail that report what should i do?
Ans:
Use SNDDST command or MIME concept.
For SNDDST the user should enrolled into the system distribution directory when
you do this in interactive , or you may use an user Id which is already in Sys Dist.
Dir in batch job.
Ans2: 1. CPYSPLF to flat file
2. CPYTOPCD from flat file to PC Doc (Folder)
3. SNDDST with Type - *DOC
7. I have a load all subfile. after doing page down let say I am in a fifth page. when i
pressed enter here it is going to page 1 again. how to handle this scenario ?
Ans:
Use SFLRCDNBR keyword and populate the nth page sfl record number
you do not have any option for selection for member,record,number of record need
to copy, mapping of fields, how many records should be copied in crtdupobj
command it just allow you get an image of existing file with same number of record
of with out record. added to above differences - cpyf command creates the new file
with same reference id but crtdupobj creates new reference id.
Or
cpyf: copy file is used to copy a file with all its field and also the AUTHORITY of that file.
ie both the file have the same user authority.
crtdupobj: creating a duplicate object will allow the user to provide his own (new) AUTHORITY
to the duplicate object.
I have a Errmsg feild in my display file . I want test this display file by passing error msg as
paramete let say 'Press F1 to Exit ' with out using RPG code is there any way I can acheive this ?
ANS:
I want to know how we can get data in xml/html format from iseries. Say I have some data in
mimix and i want to get that data in a web page.
Or I have seen some example where total disk space or libary space of system is coming on a
web page .
Ans: From windows, you need to programatically establish connection to AS400
server, and through that connection you need to fetch data from Tables, and then
you need to format that data, i.e. the way we show our normal webpages from any
other data base.
You can program yourself or you can buy tools which can do this for you.
Bit occupied these day, will give detailed answer on what all tools can be used. For
now you can search those tools from Google :-) which can display web pages using
AS400 data.
I know this is an age old question but can someone give me the conclusive answer to this one for
various data types.
Ans: Some links to answer this question:
http://systeminetwork.com/article/move-free-format-rpg-iv-part-ii
.
http://forums.systeminetwork.com/isnetforums/archive/index.php/t-13166.html
....
.
MOVE can move between dissimilar data types, EVAL can not.
MOVE can not be used in free-format RPG, EVAL can be used.
MOVE => EVALR
MOVEL => EVAL
..
If you want to move between dissimilar data types using EVAL you need to use the
built-in functions e.g. %char, %dec, %date, etc...
command "STRDBG"
for debugging first we have to set the control point...ie from which line we have to start the
debugging....for that take cursor on that line press "F6"...it will appear as white..now go out of
the program by "F3"..
now call the pgm(ie run the pgm)...take F10. to go through each step...while you can take option
'F11' to know the value of the variable..by put cursor on that variable..
(suppose your rpg pgm call another CL pgm you can also debug that)
Hi all
I am very new to the programing on AS400
I just created one CL PGM on the system to automate our health check which we do manually.
1)I have created a job and scheduled on daily basis, this will call my PGM where it contains the
subsystem,Disk status,ASP,lines,controlles in form of spool file.
As part of the out put of my Job it will create the spool files on the system, Now I want to copy
all the spool files in to PF and need to send an email to us...
so can any one guide me how can I modify my PGM to copy all the spool files in to one PF
automatically and need to send an email from the system....
1. I have an Physical File for which i had started journaling before a long time
ago.
Now accidently i have deleted the Physical file. How can i come to know the
name of the journal , in which i have journaled my file.
2. Can i Get back my file to the original state without using my backup tape.
3. If a deleted file's journal can't be predicted then how can i search the name
of the journal for any existing file.
This command will list all data in the journal to MYOUTF (outfile), and from here you
can get all data of file, even if it is deleted/recompiled. You can get the data from
here.
But you must know which file's data you want, otherwise i am sorry !
If you don't know which file's data is to be seen, then nobody can help
Now in this outfile the entries where JOENTT='PT' will give you the data which is
added to your PF being journaled.
Can anyone explain me the use of Assume and Keep keywords in display file?
Ans: Assume keeps the old data when a new screen is displayed.
Keep keeps the old screen data on screen after the old program is finished.
Both help in overlay.
But assume is for a running process. where as keep is to play between two
processes.
I Want to comapre the within same file one fieLd how many records are same.??In
SQL/RUNQRY is it possible to findout ?
How many reocrds are equal for this field F1TID---(F1TID = F1TID)
select F1TID, count(*) from customerpf order by F1TID having count(*) > 1
It will give you how many same record for field F1TID
actually i didn't understand wat you want exactly...........might be it will help you..
otherwise if you want to use a same file as different one to compare anything
you can use self join ............it work as two file for single file
like...........
select F1TID, count(*) from customerpf GROUP BY F1TID having count(*) > 1
the searcing criteria may be different but by this you can imagine that there are two
file which have exactly same data............
MAPFLD
What is the use of MAPFLD in OPNQRYF?
Ans:
Sample QRY:
DOB Zoned 8, 0 in the file EMPFILE and date format is YYYYMMDD. We are
extractracting MM from this date field.
Question:-Do we have any way to read the data from two data member of a PF
same time in pgm1.
Say for example:- we have a pf with 4 data member and want to read this pf in
pgm1 with 2 data member only at a time with CL or overdbf in RPG4.
Ans: Create a LF over two members and use it or use EXTMBR and USROPN
keywords on F-Spec
Assume you have two members MBR1 and MBR2 on File - FILE
FFile IF E DISK ExtMbr(MbrName) UsrOpn
D MbrName S 10A
/Free
MbrName = 'MBR1 ;
Open(e) File ;
Read File ;
Dow Not %Eof (File) ;
-----
-----
-----
Read File ;
EndDo ;
Close(e) File ;
MbrName = 'MBR2 ;
Open(e) File ;
Read File ;
Dow Not %Eof (File) ;
-----
-----
-----
Read File ;
EndDo ;
Close(e) File ;
*Inlr = *On ;
/End-Free
2) File B having 1 field with length 6 and it is also a alpha Numeric field.
File A
******
EmpNam: arunkumarR-----this the field in file A with length 10 record as(arunkumarR)
When Copying this to file B, I want to increase the length of the field in file B from 6 to 10 and I
need the output as
File B
******
EmpNam: arunkumarR
You need to change the file B first then perform copy, thats the way.
When we have character data in a numberic field this is decimal data error.
We need to initialize numeric field with some value to get rid of it.
Other than %ELEM you need to read the array backwards and continue till you find
an element which is non blank or non-zero.
CSRLOC
Cursour location keyword - CSRLOC - what is the exact purpose of this? Why do we use it?
Ans:
Hii,
I want a sql query on db2 which read 100th to 200th record of selected record.
I used rrn() but it gives the original record no. but when we will select on some where clause
then i want particular record no in selected record.
How???????????
1.Can any one explain me how to define PSHBTNFLD & PSHBTNCHC in STRSDA not in
DDS?
2.How to control BUTTONS (PSHBTNCHC) to come in different lines with gap not
attached.......I know to control the gap using *GUTTER between swithces in d same line but I
cant able to control the gap in btwn two lines
Ans:
DDS offers limited possibilities to enter the key words. Some key words can not be
entered from STRSDA and need manual intervention.
I tried to add the key words you mentioned from SDA, but could not find how to add
them from SDA. :-(
IBM should offer way to add any desired keyword from SDA. :-) Or I need to learn
more about SDA.
Q:
How can I load more than 22,000 records through Load all subfile?I know load all having only
possible with 9999 reocrds and page up and page down will be handling by system.But my
program having FOLD and DROP functionality as well.Also program is on production system
and it is hard to conevrt to any other subfile.Please let me how I can resolve the above issue so
that my customer will see more than 9999 record(on page 10 records are displaying) on screen
and he can do page up and page down.Please reply me as soon as possible with example so that I
can fix it the issue.?
Ans:
Hi, You need to reload the subfile, so that it loads in such a ways that user stays on
the same page where he was earlier.
You can store values in subfile so that you can key to same record.
Or you can display a message to your user saying max length is reached, the screen
will be reloaded when you press <Pagedown>. (some thing like this).
FOLD/DROP is no issue. The problem is that subfile can not contain more than 9999
under any circumstances. There is no way to load more than 9999 at one time. We
can only create illusion.
RCVJRNE
Hiii,,,,,,,
Q:
I am using RCVJRNE command to retrieve the information from Journal Entry. I am getting all
updates also..
But if I compile my pf.and then retrieve the data then I am getting the information after
compilation Only..
Wat I actually need is the entire info..ie, before and after compilation...
Ans:
have u specified RCVRNG(*CURCHAIN) and INCENT(*ALL)
Can u show ur RCVRNG command string if above does not work.
Or
DSPJRN JRN(JRNLIB/JRN) FILE((LIB/FILE)) RCVRNG(*LIBL/FIRST *LIBL/LAST)
ENTTYP(*RCD) OUTPUT(*OUTFILE) OUTFILE(MYLIB/JRNOUT) ENTDTALEN(*CALC)
I used the above command to get the journal details. As Neeraj said, we need to
mention the receiver range.
Added to this if you want to see the entire details i.e file open, close etc. you need
to go for ENTTYP(*ALL) instead of ENTTYP(*RCD).
Q: question on STRSQL
How to get the data from a member of a PF (not the first one) using STRSQL.
I cannot do OVRDBF before using STRSQL.
exfmt displayfile
field1 ADD field2 field3
exfmt displayfile
Hi,
Can anybody tell me how to reduce the window size in window subfile.
Ans:
go to the dds of the file and find the parameters for the window subfile name.
we can change their parameters.