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

Comma separations between columns


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Tue Jan 08, 2008 5:14 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 08, 2008 5:45 pm
Reply with quote

How did you "extracted" the records from DB2? Do you use any utility/tool or a home-written program?

O.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jan 08, 2008 6:03 pm
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jan 08, 2008 6:06 pm
Reply with quote

Marso's option 1 is the easiest but make sure the numerics aren't going to appear as packed decimal.
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Tue Jan 08, 2008 6:14 pm
Reply with quote

i used the platinum utility to extract records from Db2
Back to top
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Tue Jan 08, 2008 6:17 pm
Reply with quote

Thanks marso for your input , i will check for the same.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Tue Jan 08, 2008 7:52 pm
Reply with quote

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
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed Jan 09, 2008 11:18 am
Reply with quote

Thanks a lot for your input sai
Back to top
View user's profile Send private message
Ruchi Singh

New User


Joined: 22 Mar 2011
Posts: 1
Location: india

PostPosted: Tue Mar 22, 2011 2:06 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 22, 2011 7:05 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Mar 24, 2011 10:10 am
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Mar 24, 2011 2:08 pm
Reply with quote

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
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
No new posts DB2 Views with Multiple SQL & Col... DB2 8
No new posts SORT - To repeat a string in same col... SYNCSORT 3
No new posts JCL - To repeat a string in same colu... JCL & VSAM 2
Search our Forums:

Back to Top