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
 
output data in CSV Format

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

New User


Joined: 22 Jun 2007
Posts: 81
Location: bangalore

PostPosted: Sat Oct 15, 2016 2:20 pm    Post subject: output data in CSV Format
Reply with quote

hello

my reqmt is dump the data in CSV format in output file.

I have declared my output file structure as

Code:
01 outrec
  10 emp-name   pic x(10)
  10 filler            pic x(1) value ','.
  10 emp-addrs   pic X(30).
  10 Filler            pic x(1) value ','.
  10 emp salay    pic s 9(5) comp-3
  10 filler            pic x(1)  value ','.
  10 emp-phone  pic 9(10)


my out put should like :
Code:
mainppss  ,ukusbangalore      ,50000,9861098610


after reading the input file , i am moving the values to corresponding outrec fields but when i am writing to output file the comma (,) is not displaying after end of fields. it showing blank.

it is coming as

Code:
mainppss   ukusbangalore       50000 9861098610

can let me know the reason
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Sat Oct 15, 2016 2:23 pm    Post subject: Reply to: output data in CSV Format
Reply with quote

same answer as
http://ibmmainframes.com/viewtopic.php?t=65480&highlight=
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1931
Location: UK

PostPosted: Sat Oct 15, 2016 4:04 pm    Post subject:
Reply with quote

Quote:
can let me know the reason

Because the code, which you have not shown, is wrong.
The snippet of code that you did show was not in code tags and you keep using the term 'file' instead of 'dataset'. If you realy mean 'file' then this is not a mainframe question and should not be posted on a mainframe forum.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1931
Location: UK

PostPosted: Sat Oct 15, 2016 4:06 pm    Post subject:
Reply with quote

Duplicate of post in DFSort. Locked.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Sat Oct 15, 2016 5:43 pm    Post subject:
Reply with quote

Is outrec defined as the 01 for an FD? If so, your VALUE clause on the variables is being ignored and you need to use WRITE ... FROM and define outrec in WORKING-STORAGE.

Since you posted nothing for us to help you, that guess is about as far as we can go.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Sat Oct 15, 2016 6:57 pm    Post subject: Reply to: output data in CSV Format
Reply with quote

Or you cleverly INITIALIZE your "outrec". Or MOVE SPACE to outrec. Or some other thing we could attempt to guess, but could tell you exactly if you showed the relevant code.
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 81
Location: bangalore

PostPosted: Sat Oct 15, 2016 8:08 pm    Post subject: Reply to: output data in CSV Format
Reply with quote

Robert is right. I defined my outrec under FD section

FD OUTPUT_FILE
01 OUTREC.
10 EMPNAME PIC X(10).
10 FILLER PIC X(1) VALUE ','.
.................................
..................................


I hope due to this Value Clause get ignored and need to define the outrec
in working storage section.

I will try this and let know.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Sat Oct 15, 2016 11:24 pm    Post subject: Reply to: output data in CSV Format
Reply with quote

Do you ever look at the diagnostic messages at the end of your compile listing?
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 81
Location: bangalore

PostPosted: Sun Oct 16, 2016 8:58 pm    Post subject: Re: Reply to: output data in CSV Format
Reply with quote

janmejay wrote:
Robert is right. I defined my outrec under FD section

FD OUTPUT_FILE
01 OUTREC.
10 EMPNAME PIC X(10).
10 FILLER PIC X(1) VALUE ','.
.................................
..................................


I hope due to this Value Clause get ignored and need to define the outrec
in working storage section.

I will try this and let know.


it is working now. thank you Robert
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

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