View previous topic :: View next topic
|
Author |
Message |
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
this is not a subroutine. independent screen.yes, I have referred to the existing running elements. We code attribute part in both MID and MOD. As we have to pass data from IMS screen to this pgm and IMSIOPCB is in LINKAGE section we have the USING clause.This is my understanding.
I have enhanced several screens but this is a fresh one so there might be flaws. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
If you are not a subroutine - you should change to a real entry statement. You have attribute bytes indicated in your DFLD and added them in your output area.
This is how I always did it - I'll just do 1 field.
DAMT DFLD POS=(15,42),LTH=11,ATTR=(MOD,NUM)
in the MID
MFLD DAMT,LTH=11,JUST=R,FILL=C'0"
in the MOD
MFLD DAMT,LTH=13,ATTR=YES |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
I am open to making these changes Sandy, but can you pls let me know in what way do you think using an ENTRY statement is going to help me with, what I think is a length mismatch ? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Just tell me WHO or WHAT is talking to IMS? Procedure division using.... indicates that your program is not talking directly to IMS - you are a subroutine and the WHO or WHAT is talking to IMS. Do you have your very own transaction and PSB?
Add up the bytes in your working storage message and then add up the bytes in both your mid and your mod and compare them. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
yes Sandy, I have my own transaction and PSB. I'll verify the bytes again. What else do we need in between to connect to IMS ? I mean there might be some systems knowledge which I dont have. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
yes Sandy , they all are 157 [w/o the filler(1700),I have removed it] . |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Take a look at your PSB - then compare that to your linkage - then your "entry" statement. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
The ONLY time you use "procedure division using" in IMS is when you are a subroutine of something else. Change that to the normal "entry". IMS needs to talk to your process.
Normally if your MFS and your working storage screen areas do not match - you get garbage on your screen. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
right..but here my program is looping again and again, it keeps running on IMS system.and transaction keeps abending continuously as soon as I restart and unlock it. so nothing comes on my screen t anytime, not even the abend message. I can see that the pgm is getting triggered when I trigger the tran so doesnt that mean that IMS and cobol are linked. Here is the PSB-
Code: |
*PANTRAN-JCL=PSB
*PANTRAN-OP1=P1800Y0I
PRINT NOGEN
*******************************************
** ALTERNATE IO PCB
*******************************************
PCB TYPE=TP,
LTERM=M3270,ALTRESP=YES,
EXPRESS=YES
*
PCB TYPE=TP,
MODIFY=YES,
EXPRESS=YES
*
PSBGEN PSBNAME=P1800Y0I,
LANG=COBOL
END |
|
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Did you copy that PSB from someone? Did you code an "entry" statement? |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
Sandy is this fine-
Code: |
001950 PROCEDURE DIVISION.
001960 ENTRY 'DLITCBL' USING I-O-LTERM-PCB
001970 ALT-LTERM-PCB-MTO
001980 ALT-LTERM-PCB-1
001990 . |
Yes PSB is copied. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Looks fine. Do you perform a "get messages" loop until end-of-messages? What comes after your entry statement? |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
After Entry-
Code: |
002030 MAINLINE-PROCESS.
002040
002050 PERFORM 0100-INITIALIZATION
002060
002070 PERFORM 0110-GET-INPUT-MSG UNTIL
002080 I-O-LTERM-STATUS NOT = SPACES |
Has anything to be added ? When am using entry my PCB is coming as invalid. PSB needs any changes? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
PERFORM 0110-GET-INPUT-MSG UNTIL
I-O-LTERM-STATUS NOT = SPACES
You need to determine whether you have no more messages or something terrible happened. You always need to check for what you EXPECT to happen - like QC - or something awful in the system - like anything other than spaces or QC. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
yes Sandy, QC was there. I just skipped that condition, anyways I have to put it later. but if it abends at CBLTDLI call only then I dont even get a chance to check the status. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
Hello Sandy. I just gt it solved. The problem was with the function-codes include. It was placed in the linkage section. Should be in Working storage. When I went to debug it showed me that Function-GU itself is invalid...! Am thankful and sorry as well as I feel that this was time wasted over a stupid miss. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
If you learned something - no time was wasted! The best way to learn is problem solving. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
right Sandy. But I still have that doubt with entry statement. why at that time was my PCB not read ? Though I'll check that again with the running code now and get back to you. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Can you scan your COBOL libraries and look for anything that has the "entry" statement? Then scan again looking for "procedure division using". If you are NOT a subroutine - you need the entry statement. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
Hmm.. I have a thought . If we transfer control from one screen to another using PF keys what would that need ? Procedure division using will be needed or its only for sybroutine thing ? Cos may be that the reason for using "Procedure Division USING". Is it a case? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
In addition, when you are a subroutine in an IMS DC environment, you should not call your subroutine dynamically - too much overhead - you would link statically. I saw an installation that every IMS program was a subroutine of a "main" program. They linked statically, so everytime a change was made, they had to run THE BIG LINK to re-link everything. Look at your compile JCL. Their system ran like a turtle. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Hmm.. I have a thought . If we transfer control from one screen to another using PF keys what would that need ? Procedure division using will be needed or its only for sybroutine thing ? Cos may be that the reason for using "Procedure Division USING". Is it a case?
NO - I have processed as many as 10 screens - maybe more - in 1 COBOL program with 1 transaction and 1 PSB. When you get to that point, I will help you. Now, if you chose to process those screens as separate sub-routines - you would use procedure-division-using, but you would always have an ENTRY statement in the main program that retrieves your message. |
|
Back to top |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
Now it worked Sandy I have assigned the task to other guy. But will you say that ims-cobol wont work with a procedure division using and without an entry statement ? cos entry didnt make any difference.I need to read abt these two.dont know about entry much.
10 screen with different layouts in single program ? am just trying to get how? Did you use the tran name or some other key field coming from screen to differentiate for which part of code to process ? but what about the MFS ? ok they should have different MFS I understand all pointing towards a single pgm but is that possible? |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
I used the same tran - same main program - from the main program user was able to select function. In my main program, I determined what they had selected and processed accordingly. I had several MFS - different names tied to the same transaction. It is possible - I did it!
You should read everything you can about HOW IMS works. Again - if you are NOT a subroutine - you NEED an entry statement. |
|
Back to top |
|
|
|