Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
write multiple lines in PS file in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Balu5491

New User


Joined: 01 Aug 2016
Posts: 11
Location: India

PostPosted: Wed Mar 07, 2018 10:27 am    Post subject: write multiple lines in PS file in cobol
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: 282
Location: Cincinnati OH USA

PostPosted: Wed Mar 07, 2018 12:00 pm    Post subject:
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: 2110
Location: UK

PostPosted: Wed Mar 07, 2018 2:24 pm    Post subject:
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: 1120
Location: Oostende, Belgium

PostPosted: Wed Mar 07, 2018 2:34 pm    Post subject: Re: write multiple lines in PS file in cobol
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: 11
Location: India

PostPosted: Wed Mar 07, 2018 3:40 pm    Post subject: Re: write multiple lines in PS file in cobol
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: 11
Location: India

PostPosted: Wed Mar 07, 2018 3:42 pm    Post subject:
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: 1303
Location: Israel

PostPosted: Wed Mar 07, 2018 5:46 pm    Post subject:
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: 11
Location: India

PostPosted: Wed Mar 07, 2018 9:48 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Accessing control blocks to retrieve ... menonkiran COBOL Programming 4 Wed Nov 14, 2018 9:08 pm
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm
No new posts Will this code extract 1 byte from fi... pkmurali CLIST & REXX 8 Sat Nov 10, 2018 11:13 pm
No new posts Writing multiple records into a CSV r... hiravibk DFSORT/ICETOOL 2 Wed Nov 07, 2018 2:35 pm
No new posts Error reading file in REXX module ashek15 CLIST & REXX 3 Wed Oct 24, 2018 4:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us