View previous topic :: View next topic
|
Author |
Message |
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Hi
i have extracted a Db2 table to a sequential file. The records have been extracted in a continous manner.
I would like know whether in the output file , can we give a seperator between the columns . if yes please provide me the jcl.
sunil |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
How did you "extracted" the records from DB2? Do you use any utility/tool or a home-written program?
O. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
It depends on how you extract your data.
One possibility is:
Code: |
SELECT FIELD1, ',', FIELD2, ',', FIELD3
FROM your.table |
Another one is to add a SORT step after the extract.
Sort parameters could be (for example):
Code: |
SORT FIELDS=(1,26,CH,A)
OUTREC FIELDS=(1,8,C',',9,10,C',',19,8,C',',27,4,C',',
31,4,C',',35,5,C',',40,1,C',',41,8,51C' ') |
|
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Marso's option 1 is the easiest but make sure the numerics aren't going to appear as packed decimal. |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
i used the platinum utility to extract records from Db2 |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Thanks marso for your input , i will check for the same. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi Sun,
In Platinum Unload you have an Option Called Comma delimiter, You can try the below Platinum SYSIN parameters.
For Ex:
Code: |
INPUT-FORMAT TABLE
OUTPUT-FORMAT COMMA-DELIMITED
COMMA '|'
DISPLAY-STATUS 100000
IO-BUFFERS 60
SORTSIZE 4M
ALLMSGS
VSAM-BUFFERS 360
SHRLEVEL I
UNLDDN SYSREC
CTLDDN SYSCTL
SQL-ACCESS EXTENSION
LOAD-CONTROL DB2LOAD |
Thanks
Sai |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Thanks a lot for your input sai |
|
Back to top |
|
|
Ruchi Singh
New User
Joined: 22 Mar 2011 Posts: 1 Location: india
|
|
|
|
I have uloaded a table with Comma delimiter, But one of the coloumns has comma as part of data in it. I want to remove these comma. How can i do that? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
First you read the forum rules.
Secondly, you do not 'hijack' a thread - especially an old one.
Thirdly you search to see if a similar topic has been discussed - there was one only last week (but it may have been the 'other' forum)
Fourthly you google to see if the answer is 'out there'
Fifthly, ask colleagues
Sixthly - if all else fails you start a new topic in the forum. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Ruchi,
Welcome to IBMMAINFRAMES forum,
Briefly explain, what you are trying to do like, you are unloading from a table to a delimited file and what are you going to do with that unload file.
Show us your UNLOAD statements, since post involves FASTUNLOAD, are you using IBM unload or platinum's fastunload.
Show us your unloaded dataset.
When posting, try to use CODE tag, its cool.
Thanks,
Sushanth |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Ruchi, welcome to IBMMAINFRAMES forum.
You do not have to remove the comma within the string, just enclose it in double quotes:
Code: |
fld1,"this is, field2",fld3 |
|
|
Back to top |
|
|
|