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
 

 

Converting PS to a CSV format

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

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Tue Feb 10, 2009 12:49 pm    Post subject: Converting PS to a CSV format
Reply with quote

Hi

I want to the code snippet which converts a PS file to CSV format

regards
raki
Back to top
View user's profile Send private message

Girish Firke

New User


Joined: 04 Feb 2009
Posts: 5
Location: Mumbai

PostPosted: Tue Feb 10, 2009 1:01 pm    Post subject: Reply to: Converting PS to a CSV format
Reply with quote

Hi raki,

You can create the record structure with comma "," between two fields.
Please see below example:

WORKING-STORAGE SECTION.
01 IN-REC.
05 IN-A PIC X(05).
05 IN-B PIC X(03).
05 IN-C PIC 9(05).
05 IN-D PIC X(02).
05 IN-E PIC 9(05) COMP-3.

02 OUT-REC.
05 OUT-A PIC X(05).
05 FILLER PIC X(01) VALUE ','.
05 OUT-B PIC X(03).
05 FILLER PIC X(01) VALUE ','.
05 OUT-C PIC X(05).
05 FILLER PIC X(01) VALUE ','.
05 OUT-D PIC X(02).
05 FILLER PIC X(01) VALUE ','.
05 OUT-E PIC X(05).

PROCEDURE DIVISION.

MOVE IN-A TO OUT-A.
MOVE IN-B TO OUT-B.
MOVE IN-C TO OUT-C.
MOVE IN-D TO OUT-D.
MOVE IN-E TO OUT-E.

WRITE OUT-REC.
GOBACK.




The output file will be in comma delimited (CSV)file.


Thanks,
Girish Firke. icon_smile.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 10, 2009 3:37 pm    Post subject:
Reply with quote

Quote:
I want to the code snippet which converts a PS file to CSV format


Need to clarify more to get better soluton.

Pasting how input file look will help?
is there any other delimeter in the file already?
or fields are seperated using there lengths?
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 Feb 11, 2009 2:25 am    Post subject:
Reply with quote

Hello,

At the top of the page is a link to "IBM Manuals" among which is the COBOL Language Reference for 3 current releases of IBM COBOL (pick the one that is in use on your system). In that manual search for the STRING statement. This will describe how STRING is coded.

In the corresponding Programming Guide, also search for STRING and there is an example. Or use this link. . .
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3pg20/1.6.1.1?

If you find something that is not clear, post what you found and your question about it.
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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