sekhar


{ City } hyderabad
< Country > india
* Profession * systems analyst
User No # 44792
Total Questions Posted # 0
Total Answers Posted # 9

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 80
Users Marked my Answers as Wrong # 44
Questions / { sekhar }
Questions Answers Category Views Company eMail




Answers / { sekhar }

Question { IBM, 13161 }

A particular job executing on the iS is not behaving as
expected and is operating in an environment in which it can
be debugged. What commands would you use to debug and
observe the program?


Answer

SBMJOB with HOLD(*YES) take the job number ,name and user
using WRKSBMJOB . then STRSRVJOB and STRDBG and F10 and come
out.the release the job WRKJOB 43 option or WRKSBMJOB with 6
option . then DSPMODSRC and start doing the debug. its like
normal debug.after completion of debugging you have to
ENDSRVJOB and ENDDBG

Is This Answer Correct ?    22 Yes 0 No

Question { IBM, 21245 }

How can we access Interactive job LDA in Batch Job?.
and How we can access a file in interactive QTEMP lib in
Batch job?.


Answer

QINTER and QBATCH are two different subsystems in iseries
box. interactive job having its own QTEPM and *LDA and batch
having its own.if u signon to QINTER means i.e a job. AS400
creates QTEMP and *LDA for each job. so each SBMJOB having
its own QTEMP and *LDA and your QINTER session having its
own. so you cannot access both at a time.

Is This Answer Correct ?    7 Yes 7 No


Question { IBM, 28828 }

1)how to do date validation in rpg?
2)how to delete dUPLICATE RECORDS?


Answer

For Date validation we can use TESTD Opcode
Duplicate records can be deleted using RRN

Is This Answer Correct ?    3 Yes 4 No

Question { IBM, 28828 }

1)how to do date validation in rpg?
2)how to delete dUPLICATE RECORDS?


Answer

1: FOR DATE VALIDATION

/FREE
TESTD(E) *ISO(WHAT EVER) DATE VARIABLE ;
IF %ERROR ;
DO SOME THING ;
ENDIF ;
/END-FREE
2: CREATE A LOGICAL ON THAT FILE WITH KEY SAY FILE1
IN RPG

FFILE1 IP E K DISK
D X S 9S 0
D
I RECORDFORMAT-FILE1
I KEYFIELD L1 (CONTROL INDICATOR)

/FREE
X += 1 ;
IF X <> 1 ;
DELETE RECORDFORMAT ;
ENDIF ;

/END-FREE
CL1 RESET X

Is This Answer Correct ?    0 Yes 2 No

Question { IBM, 58800 }

How I can reread the physical file in CL program once the
end of file reached in same CL program.


Answer

PGM
DCLF FILE(FILENAME)
READ: RCVF RCDFMT(RECORDFORMAT)

MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
OPERATIONS
GOTO CMDLBL(READ)
END: ENDPGM

Is This Answer Correct ?    10 Yes 20 No

Question { IBM, 58800 }

How I can reread the physical file in CL program once the
end of file reached in same CL program.


Answer

In V5R4M0 , we can declare 5 files in CL-ILE pgm

DCLF (FILE1) OPENID(OP1_)
DCLF (FILE2) OPENID(OP2_)
DCLF (FILE3) OPENID(OP3_)
DCLF (FILE4) OPENID(OP4_)
DCLF (FILE5) OPENID(OP5_)

DCL &LGL *LGL VALUE('1')

DOWHILE (&LGL = '1')

RCVF (RCDFMT_FILE1)

MONMSG MSGID(CPF0864) EXEC(LEAVE)

OPERATIONS

ENDDO

SIMILAR TO ALL 4 FILES....

Is This Answer Correct ?    4 Yes 5 No

Question { IBM, 58800 }

How I can reread the physical file in CL program once the
end of file reached in same CL program.


Answer

Answer 11 is correct when the version of your iSeries is V6 and above. For V5R* , I guess CLOSE key word is not there.
For V5R4 systems... you can approach below solution.

Declare the same file two times with different OPENIDs

Before first RCVF , do OPNDBF and read the file. After reaching EOF do CLOF

Then do OPNDBF for second OPNID and do the same again.

Is This Answer Correct ?    2 Yes 1 No

Question { 11036 }

In there is 100 no. of recordsin PF, if i delete all the
records. Then what is the Size of the PF?


Answer

If you Delete the record, size of PF will not change. You
have to Reorganize the file using RGZPFM. Then only you can
reclaim the space by deleted records.

Is This Answer Correct ?    31 Yes 0 No

Question { HSBC, 12447 }

How to create a key field for a logical file inside RPG?


Answer

use LikeRec(RECFMT:*KEY)

Is This Answer Correct ?    1 Yes 5 No