Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Its Not looping properly....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
munna_ibm

New User


Joined: 23 Apr 2005
Posts: 16
Location: chennai

PostPosted: Thu May 11, 2006 6:01 pm    Post subject: Its Not looping properly....
Reply with quote

Hi ,

I encounter some problem in loop, Pls help me out of this. My requirement is i have two files(Dept, Emp) iam check the particular dept, from that dept corresponding empno. iam retrieveing the emp record from emp file (with the dept file empno.) and finally i want to display all the details of the corresponding dept employees.

i coded it but it retrieve only one record and exiting from the pgm/loop. Pls let me help in this looping.......

the code is.

PRINT NOGEN
EMPPROJ2 CSECT
STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAVE+4
LR 2,13
LA 13,SAVE
ST 13,8(0,2)
*ENTRY LINKAGE ENDS
*
FL1 OPEN (DEPDS,INPUT)
LTR 15,15
BZ FL2
ABEND 901
*
FL2 OPEN (EMPDS,INPUT)
LTR 15,15
BZ OK
ABEND 902
*
OK GET DEPDS,DEPBUFF
CLC DEPT,=C'MF'
BNE OK
* CLC TEMPNO,DEMPNO
* BE OK
MVC DATA,DEPBUFF
WTO TEXT=MSG
OK2 GET EMPDS,EMPBUFF
CLC DEMPNO,EMPNO
BNE OK2
MVC DATA,EMPBUFF
MVC DATA+23,DEPT
MVC DATA+26,DESIGN
WTO TEXT=MSG
* MVC TEMPNO,DEMPNO
B OK
*
EOF WTO 'EOJ'
CLOSE (DEPDS)
CLOSE (EMPDS)
*
EXIT SR 15,15
*
*EXIT LINKAGE STARTS
L 13,SAVE+4
L 14,12(0,13)
LM 0,12,20(13)
BR 14
SAVE DS 18F
*TEMPNO DC CL4' '
*
DEPDS DCB DSORG=PS,MACRF=GM,DDNAME=JDEP,EODAD=EOF
DEPBUFF DS CL80
ORG DEPBUFF
DEPT DS CL2
DS CL1
DEMPNO DS CL4
DS CL1
DESIGN DS CL8
DS CL64
ORG
*
EMPDS DCB DSORG=PS,MACRF=GM,DDNAME=JEMP,EODAD=EOF
EMPBUFF DS CL80
ORG EMPBUFF
EMPNO DS CL4
DS CL1
PROJ DS CL5
DS CL1
PLACE DS CL5
DS CL1
SALARY DS CL5
DS CL58
ORG
MSG DC AL2(80)
DATA DS CL80
END



Even corrections/new logics are welcome....
Back to top
View user's profile Send private message
References
PostPosted: Thu May 11, 2006 6:01 pm    Post subject: Re: Its Not looping properly.... Reply with quote

Bharanidharan

Active User


Joined: 20 Jun 2005
Posts: 100
Location: Chennai, India

PostPosted: Fri May 12, 2006 7:44 pm    Post subject: Re: Its Not looping properly....
Reply with quote

Change:
MVC DATA+23,DEPT
MVC DATA+26,DESIGN
To:
MVC DATA+23(2),DEPT
MVC DATA+26(8),DESIGN
You will hit the target.
With your code not explicitly mentioning the number of bytes to move, system assumes a number resulting in violation of the storage beyond the accessible. The result would be unprecditable.

Regards,
Bharani.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1