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
 

 

how to define a varing length output record variable

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

New User


Joined: 27 May 2010
Posts: 43
Location: da lian.china

PostPosted: Tue Jun 29, 2010 11:52 am    Post subject: how to define a varing length output record variable
Reply with quote

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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 29, 2010 5:49 pm    Post subject:
Reply with quote

Can you not use LIKE= in the JCL to do it for you
Back to top
View user's profile Send private message
robert-ohlen

New User


Joined: 01 Jun 2007
Posts: 11
Location: Soiron

PostPosted: Wed Jun 30, 2010 12:41 am    Post subject:
Reply with quote

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

New User


Joined: 27 May 2010
Posts: 43
Location: da lian.china

PostPosted: Wed Jun 30, 2010 7:00 am    Post subject:
Reply with quote

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

New User


Joined: 27 May 2010
Posts: 43
Location: da lian.china

PostPosted: Wed Jun 30, 2010 7:02 am    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Wed Jun 30, 2010 8:51 am    Post subject:
Reply with quote

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

New User


Joined: 27 May 2010
Posts: 43
Location: da lian.china

PostPosted: Wed Jun 30, 2010 9:06 am    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Wed Jun 30, 2010 9:30 am    Post subject: Reply to: how to define a varing length output record variab
Reply with quote

Good to hear it is working - thank you for posting your solution icon_smile.gif

Quote:
If it can be for your only slightly value of reference, I will be very happy.
Yes, your solution will help another someday icon_smile.gif

Good luck,

d
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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