View previous topic :: View next topic
|
Author |
Message |
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
Hi,
I'm now migrating PL/1 programs to Entereprise PL/1 and i encounter a strange problem. First I'll make one thing clear - I'm not at all familiar with PL/1 and so i dont even know the basics of the language.
I migrated a program in PL/1 to Enterprise PL/1. The output file(say output1) of the PL/1 program contains some 100,000 records. But the output file of the Enterprise PL/1 program contains only 5 records - that too some garbage value. I have not made any code change to the program. So this seems very strange to me.
Also, i found that, there is no "DCL" "OPEN FILE" or "CLOSE FILE" statement found for this output file. Just a "WRITE FILE" command. I tried including these statements and running the job. But still the records were not writen to the output file.
The program calls few other PL/1 programs. these programs have also been migrated to enterprise version. The called programs also do not contain any "OPEN FILE" statement.
I added a "put skip list" before the "WRITE" statement and found that all records are being written to SYSOUT. so i assume that all records are being written to the file and getting deleted at the end due to some reason.
Saradha |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Is your JCL all right? |
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
The JCL is fine.... I executed both the programs - (enterprise version and the non-enterprise version) using the same JCL. So the JCL is fine.
Saradha |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Can you post the write part and the DD-statement of that file using the code-button? |
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
There are so many WRITE statements in the program.
Code: |
WRITE FILE (CATXOUT) FROM (INCATX); |
DD statement
Code: |
//CATXOUT DD DSN=A0077T.PRL.ACATX(+1),
// UNIT=SMS,DISP=(,CATLG,DELETE),
// DCB=(RECFM=VB,LRECL=18247,BLKSIZE=0),
// SPACE=(CYL,(1000,75),RLSE) |
But I'm not sure if this is what you are asking for.[/code] |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
You have to test the return code after the WRITE statement,
and also compute a sort of Counter after it :
CTRWRT =CTRWRT + 1; to be displayed at the end.
Can you show the Declare File and the definition of the I/O INCATX.
Regards
Pierre |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Using VB the LRECL should be maximum recordlength plus 4 and BLKSIZE maximum recordlength (or multiple) plus 8 in order to store the lenght (preamble). |
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
declaration of INCATX
Code: |
DCL INCATX CHAR(18243) STATIC VARYING;
DCL 1 XINCATX BASED (XCATXPTR),
2 XCATXFIL1 CHAR(2),
2 XCATXFIL2 CHAR(1); |
As I told in my previous posts, there are so many WRITE statements in the program. I tried abending the program after one of the WRITE statements and found that there were around 10000 records in the OUCATX file now. So it means something happens in the program after the WRITE statement that makes the file to lose all data.
Just let me know this - How can we write to a file without opening the file?? This is one starnge thing i could not understand. - there was not even one single "OPEN FILE" statement found for the OUTCATX file in the program. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
That was the strength of PL/1. No need to close a file; after execution it was done automatically. Not neat though
Does your program end succesfully? Remember a new GDG version is catalogued after completion. Your third DCB-parameter tells DELETE, so if your program abends your new version is gone. Is there perhaps an ON coding in your program telling not to abend after a severe error? We call this the ERROR BLOCK and is something like:
Code: |
ON ERROR BEGIN;
RETURNCODE = 0
END;
There are several options to capture an error like DATA EXCEPTION.
If there's an ON-block (should be in the beginning of the program) check if it's been hit. |
|
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
Quote: |
and also compute a sort of Counter after it :
CTRWRT =CTRWRT + 1; to be displayed at the end.
|
I used a counter and found that the value at the end of the program was 100365 - the exact count of records that i got in the output file when i ran the job with the program compiled with PLI.
This problem occurs only in the enterprise version of the PLI. So if anyone familiar with migration from PLI to Enterprise PLI, can you please help?? |
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
One more finding - There are 100365 records written to the output file when the program is run with old PLI compiler version. Of these, 5 records are written by a called program. I commented out the CALL statement and ran the program - and i found that 100360 records were written to the output file. But if i run the program with the CALL statement, only 5 records are written to the output file. So this means that, when the called program is executed, the program erases out all the records previously written to the output file and writes in only the five records.
The file has no DCL statement in the main program. But it has a DCL statement in the called program. Will this affect anything?
And is this due to any difference between PLI and Enterprise PLI? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
The file has no DCL statement in the main program. But it has a DCL statement in the called program. Will this affect anything? |
My remark will sound very unpleasant,
but it is my opinion that the behavior of enterprise pli is the correct one
I would say that the old pl1 would let You slip by an illogic behavior
Also not having DCL, OPEN, CLOSE is a bad programming practice..
I would run some tests
1) declare the file also in the main program
if the behavior is the same
2) declare the file in the called program as external
see what happens |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Are the 5 records that "survive" in the original code the last 5 written?
It may be that "something" is causing the file to be closed and re-opened as output and this positions it to the beginning of the file. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Quote: |
The file has no DCL statement in the main program. But it has a DCL statement in the called program. Will this affect anything?
|
????
So you skip executing the called program where the definition(s) of file(s?) reside(s) and it is working? Strange!
Other :
- what is your input if there is one. You read a file into ... because INCATX sounds like an input...
- Dick's remark can be a good start : you have 5 records, can you identify them : last one's, consistent with layout?
- stop executing when counter reachs 100365 exactly at that statement. |
|
Back to top |
|
|
Saradha Ramalingam
New User
Joined: 04 Jan 2007 Posts: 23 Location: Chennai
|
|
|
|
Thanks a lot everyone for ur suggestions. The problem is now solved. I recompiled the called module also in Enterprise PL/1 and the problem was solved. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
That's nice for you. But.........you fooled us a bit posting this in your original question:
Quote: |
The program calls few other PL/1 programs. these programs have also been migrated to enterprise version. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is solved!
Thank you for posting the solution - it may help another person sometime |
|
Back to top |
|
|
abhilash g s
New User
Joined: 27 Apr 2007 Posts: 37 Location: bangalore
|
|
|
|
Hi All,
I am learning and coding a batch program in PL1.
can anyone help me in getting a sample batch program structure of PL1.
Thank you. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
abhilash g s
Please start a new thread.
Take care of the warning ..... |
|
Back to top |
|
|
|