View previous topic :: View next topic |
Author |
Message |
psmadhusudhan Beginner
Joined: 28 Nov 2006 Posts: 143 Topics: 48
|
Posted: Mon Sep 19, 2011 8:13 am Post subject: Inserting ASCII value of Tab key |
|
|
Hi,
I have to prepare one file where fields are seperated by Tab Key(file is verified after transmitted to user end in text format). ASCII value of tab key is 09.
Suppose below is my record structure, please let me know how to insert ascii value of tab key in between fields either through COBOL program or through SORT or by another usefull means.
Name PIC X(10)
ID PIC 9(10)
Branch PIC X(20) _________________ Thanks
Madhu Sudhan |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Sep 19, 2011 10:26 am Post subject: |
|
|
psmadhusudhan,
Is this a trick question? Define a TAB-VALUE PIC X and move the hex value.
Code: |
Name PIC X(10)
TAB-VAL1 PIC X
ID PIC 9(10)
TAB-VAL2 PIC X
Branch PIC X(20)
MOVE X'09' TO TAB-VAL1
TAB-VAL2
|
or with sort
Code: |
INREC BUILD=(1,10,X'09',11,10,X'09',21,20)
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Sep 19, 2011 10:47 am Post subject: |
|
|
do the contents of NAME and ID contain ASCII or ebcdic data? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
psmadhusudhan Beginner
Joined: 28 Nov 2006 Posts: 143 Topics: 48
|
Posted: Mon Sep 19, 2011 7:45 pm Post subject: |
|
|
kolusu,
No this is not trick question, I dont know whether this movement will really give tab key in the final file or not, thats why I have posted the question.
One small query if we move hexadecimal '09' is it same as ASCII value. Dont mind if it is stupid question.
I will try your solution and let you know.
dbzTHEdinosauer,
NAME and ID eBCDIC data _________________ Thanks
Madhu Sudhan |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Sep 20, 2011 10:24 am Post subject: |
|
|
psmadhusudhan wrote: | kolusu,
No this is not trick question, I dont know whether this movement will really give tab key in the final file or not, thats why I have posted the question.
One small query if we move hexadecimal '09' is it same as ASCII value. Dont mind if it is stupid question. |
psmadhusudhan,
I guess you got it all wrong. If your intention is to FTP/XMIT a mainframe file to PC then you need to use the EBCDIC value of the tab (X'05') and it get automatically transferred to the corresponding tab value on the PC side. So move X'05' as tab value between fields and then FTP/XMIT the file to PC.
Kolusu |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Sep 30, 2011 11:21 am Post subject: |
|
|
I agree with your latest post, Kolusu.
If you separate columns in a file with tab characters (hex 05) and ftp it to a Windows platform and save it as a .prn file, when the file is opened it will open as Excel.
This works better than a .csv file (comma-separated values) at times, in case a comma may be part of your data. Then your fields are not aligned correctly. |
|
Back to top |
|
|
|
|