View previous topic :: View next topic
|
Author |
Message |
liying
New User
Joined: 27 May 2010 Posts: 47 Location: da lian.china
|
|
|
|
In PLI programe, if I want to write data to output file, I have to declare a variable that have the same length with the output file's length that have been defined in the JCL, then I can write the data from this variable to the output file.
The problem is I want to define a variable whose length is according to the parameter from the input file, how can I do this.
eg:
when input file's parameter =120
then output record variable's length=120
when input file's parameter =60
then output record variable's length=60 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Can you not use LIKE= in the JCL to do it for you |
|
Back to top |
|
|
robert-ohlen
New User
Joined: 01 Jun 2007 Posts: 11 Location: Soiron
|
|
|
|
are you obliged to define the file in the JCL?
if this is not the case, it is possible to use the ENV statement file and dynamically set the file using OPEN TITLE |
|
Back to top |
|
|
liying
New User
Joined: 27 May 2010 Posts: 47 Location: da lian.china
|
|
|
|
expat wrote: |
Can you not use LIKE= in the JCL to do it for you |
I am sorry, I can not understand you very well.
How can I use LIKE=?
Would kindly pls explain it more exactly? |
|
Back to top |
|
|
liying
New User
Joined: 27 May 2010 Posts: 47 Location: da lian.china
|
|
|
|
robert-ohlen wrote: |
are you obliged to define the file in the JCL?
if this is not the case, it is possible to use the ENV statement file and dynamically set the file using OPEN TITLE |
I am really very sorry that I know very few about ENV statement.
Would you kindly pls explain how to use it more specifically? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
How can I use LIKE=?
Would kindly pls explain it more exactly? |
LIKE is a JCL parameter and as such can be found in the JCL Language Reference (available via the "IBM Manuals" link at the top of the page).
Similarly, info about ENV can be found in the pl/i programming guide (also available via the "IBM Manuals" link).
The flashlight/tubelight near the top left is the search feature for the manual.
If you find something that is not clear in the documentation, post what you found and your doubt. Someone will be able to clarify. |
|
Back to top |
|
|
liying
New User
Joined: 27 May 2010 Posts: 47 Location: da lian.china
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
How can I use LIKE=?
Would kindly pls explain it more exactly? |
LIKE is a JCL parameter and as such can be found in the JCL Language Reference (available via the "IBM Manuals" link at the top of the page).
Similarly, info about ENV can be found in the pl/i programming guide (also available via the "IBM Manuals" link).
The flashlight/tubelight near the top left is the search feature for the manual.
If you find something that is not clear in the documentation, post what you found and your doubt. Someone will be able to clarify. |
Thank you for your help.I have find them out from the IBM Manual.
But I don't think these two ways can solve my problem.But still I feel many thanks for your guide.
And at the same time, my problem have been solved by the following mathod. If it can be for your only slightly value of reference, I will be very happy.
DCL OUTPUT_RECORD CHAR(10000) VARYING;
WRITE FILE(OUTPUT1) FROM(OUTPUT_REOCRD);
JUST TO DECLARE THE OUTPUT_REOCRD TO BE VARYING,then it can be write to an output file in any length smaller than '10000'. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for posting your solution
Quote: |
If it can be for your only slightly value of reference, I will be very happy. |
Yes, your solution will help another someday
Good luck,
d |
|
Back to top |
|
|
|