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: 1353
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: 19244
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top