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

Creating TAB delimited output file


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Wed Jan 23, 2008 6:35 pm
Reply with quote

Hi all,

Is is possible to create a tab delimited output file in Cobol ?

How willl we declare the same ?


Regards,
Arien
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jan 23, 2008 7:01 pm
Reply with quote

Yes. It would most likely be a variable length file. COBOL knows nothing about tab delimited, you have to fill in the data and the tab delimiters.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Jan 23, 2008 7:03 pm
Reply with quote

I create tab delimited datasets regularly in REXX and SAS. I'm sure you can do the same using COBOL. I will assume the dataset will be FTP'ed down to your PC and imported into EXCEL.

When you define your output fields, place a X'05' (HEX 05) in between each field. This will allow EXCEL to place each field in it's own cell when you import the file.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1356
Location: Israel

PostPosted: Wed Jan 23, 2008 8:34 pm
Reply with quote

don't forget, in COBOL you can write:
Code:
    01 TAB-CHAR       PIC  X   VALUE X'05'.
Back to top
View user's profile Send private message
arien

New User


Joined: 02 Nov 2006
Posts: 43
Location: London

PostPosted: Wed Jan 23, 2008 10:14 pm
Reply with quote

Many thanks guys.. I'll try this declaration ..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jan 23, 2008 11:48 pm
Reply with quote

Hello,

One way i use is:

Code:
  MOVE SPACES TO ICE-OUT-1D-REC.
  STRING ICN               X'05'   
         RCD-TYPE          X'05'   
         CLM-TYPE-ALPHA    X'05'   
         DTL-NBR           X'05'   
         DTL-FDOS          X'05'   
         DTL-TDOS          X'05'   
       .
       .
         DTL-NON-COV-DAYS  X'05'                       
         DTL-NON-COV-CHG   X'05'                       
         HDR-TYPE-BILL     X'05' DELIMITED BY '\'     
    INTO ICE-OUT-1D-REC.                                 
  WRITE ICE-OUT-1D-REC.                                   


Also, when downloading to unix or some win-based application (i.e. EXCEL) all of the numeric fields should be coverted to edited "text" before they are put into the download file.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
Search our Forums:


Back to Top