IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

write multiple lines in PS file in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Balu5491

New User


Joined: 01 Aug 2016
Posts: 14
Location: India

PostPosted: Wed Mar 07, 2018 10:27 am
Reply with quote

Hi All,

I have a group variable.

01 WA-DETAILS.
05 WA-NAME PIC X(80) VALUE 'JOHN'.
05 WA-ID PIC X(80) VALUE '1234'.

When i try to write the details into a PS file of LRECL=80,

WRITE OUTPUT-FILE FROM WA-DETAILS.

I am getting the first line written in the PS file, not the second line with ID. Could you please help to identify an option to write two lines.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 418
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Wed Mar 07, 2018 12:00 pm
Reply with quote

WRITE OUTPUT-FILE FROM WA-DETAILS(01:80).
WRITE OUTPUT-FILE FROM WA-DETAILS(81:80).


I think you're really looking for something else.

Describe what you really want to accomplish.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Mar 07, 2018 2:24 pm
Reply with quote

Please use the code tags when posting stuff that appears on your mainframe screen. Compare below with what is in your post. This is correctly formatted and yours is not even though this was copied from your post.
Code:
01 WA-DETAILS.
     05 WA-NAME PIC X(80) VALUE 'JOHN'.
     05 WA-ID      PIC X(80) VALUE '1234'.

Details of how to use the code tags, and others, are all over the place.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Mar 07, 2018 2:34 pm
Reply with quote

Balu5491 wrote:
Hi All,

I have a group variable.
Code:

01 WA-DETAILS.
     05 WA-NAME PIC X(80) VALUE 'JOHN'.
     05 WA-ID      PIC X(80) VALUE '1234'.


When i try to write the details into a PS file of LRECL=80,

WRITE OUTPUT-FILE FROM WA-DETAILS.

I am getting the first line written in the PS file, not the second line with ID. Could you please help to identify an option to write two lines.

And what makes you think stuffing 160 bytes into a record that can contain only 80 will work?

You're working on z/OS with records, not on Windoze with streams!
Back to top
View user's profile Send private message
Balu5491

New User


Joined: 01 Aug 2016
Posts: 14
Location: India

PostPosted: Wed Mar 07, 2018 3:40 pm
Reply with quote

prino wrote:
Balu5491 wrote:
Hi All,

I have a group variable.
Code:

01 WA-DETAILS.
     05 WA-NAME PIC X(80) VALUE 'JOHN'.
     05 WA-ID      PIC X(80) VALUE '1234'.


When i try to write the details into a PS file of LRECL=80,

WRITE OUTPUT-FILE FROM WA-DETAILS.

I am getting the first line written in the PS file, not the second line with ID. Could you please help to identify an option to write two lines.

And what makes you think stuffing 160 bytes into a record that can contain only 80 will work?

You're working on z/OS with records, not on Windoze with streams!


I want the OUTPUT-FILE with 80 LRECL needs to populated the first WA-NAME variable in first line and WA-ID in the second line.

like
Code:

***************************** Top of Data ******************************
JOHN
1234
**************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Balu5491

New User


Joined: 01 Aug 2016
Posts: 14
Location: India

PostPosted: Wed Mar 07, 2018 3:42 pm
Reply with quote

dneufarth wrote:
WRITE OUTPUT-FILE FROM WA-DETAILS(01:80).
WRITE OUTPUT-FILE FROM WA-DETAILS(81:80).


I think you're really looking for something else.

Describe what you really want to accomplish.


I want the OUTPUT-FILE with 80 LRECL needs to populated the first WA-NAME variable in first line and WA-ID in the second line.

like
Code:

***************************** Top of Data ******************************
JOHN
1234
**************************** Bottom of Data ****************************


_________________
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Mar 07, 2018 5:46 pm
Reply with quote

If
dneufarth wrote:
WRITE OUTPUT-FILE FROM WA-DETAILS(01:80).
WRITE OUTPUT-FILE FROM WA-DETAILS(81:80).
is not good enough, try:
Quote:
WRITE OUTPUT-FILE FROM WA-NAME.
WRITE OUTPUT-FILE FROM WA-ID.
Back to top
View user's profile Send private message
Balu5491

New User


Joined: 01 Aug 2016
Posts: 14
Location: India

PostPosted: Wed Mar 07, 2018 9:48 pm
Reply with quote

I am comfort in using

WRITE OUTPUT-FILE FROM WA-NAME.
WRITE OUTPUT-FILE FROM WA-ID.

Thanks Marso, Robert, Dave. 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top