Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Migration to Enterprise PL/1 - problem in writing to files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 7:04 pm    Post subject: Migration to Enterprise PL/1 - problem in writing to files
Reply with quote

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. icon_confused.gif

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. icon_cry.gif

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
View user's profile Send private message

Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Fri Oct 26, 2007 7:12 pm    Post subject:
Reply with quote

Is your JCL all right?
Back to top
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 8:06 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Fri Oct 26, 2007 8:31 pm    Post subject:
Reply with quote

Can you post the write part and the DD-statement of that file using the code-button?
Back to top
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 9:01 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Fri Oct 26, 2007 10:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Fri Oct 26, 2007 10:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 10:45 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Fri Oct 26, 2007 10:53 pm    Post subject:
Reply with quote

That was the strength of PL/1. No need to close a file; after execution it was done automatically. Not neat though icon_redface.gif

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
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 10:54 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Fri Oct 26, 2007 11:26 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Oct 26, 2007 11:41 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Oct 27, 2007 12:51 am    Post subject:
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Sat Oct 27, 2007 1:47 am    Post subject:
Reply with quote

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
View user's profile Send private message
Saradha Ramalingam

New User


Joined: 04 Jan 2007
Posts: 23
Location: Chennai

PostPosted: Thu Nov 01, 2007 4:24 pm    Post subject: Reply to: Migration to Enterprise PL/1 - problem in writing
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Nov 01, 2007 4:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 01, 2007 7:40 pm    Post subject:
Reply with quote

Good to hear it is solved!

Thank you for posting the solution - it may help another person sometime icon_smile.gif
Back to top
View user's profile Send private message
abhilash g s

New User


Joined: 27 Apr 2007
Posts: 37
Location: bangalore

PostPosted: Mon Nov 12, 2007 3:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Mon Nov 12, 2007 4:38 pm    Post subject:
Reply with quote

abhilash g s

Please start a new thread.

Take care of the warning ..... icon_mad.gif icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us