|
View previous topic :: View next topic
|
| Author |
Message |
arien
New User

Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
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 |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
| 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 |
|
 |
cpuhawg
Active User

Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
don't forget, in COBOL you can write:
| Code: |
| 01 TAB-CHAR PIC X VALUE X'05'. |
|
|
| Back to top |
|
 |
arien
New User

Joined: 02 Nov 2006 Posts: 43 Location: London
|
|
|
|
| Many thanks guys.. I'll try this declaration .. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|