IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Its Not looping properly....

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
View previous topic :: View next topic  
Author Message
munna_ibm



Joined: 23 Apr 2005
Posts: 16
Location: chennai

Posted: Thu May 11, 2006 6:01 pm    Post subject: Its Not looping properly....  

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  
Bharanidharan



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

Posted: Fri May 12, 2006 7:44 pm    Post subject: Re: Its Not looping properly....  

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  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM