Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comma separations between columns

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Comma separations between columns
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: 2360
Location: Israel

PostPosted: Tue Jan 08, 2008 5:45 pm    Post subject:
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: 1226
Location: Israel

PostPosted: Tue Jan 08, 2008 6:03 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1756
Location: UK

PostPosted: Tue Mar 22, 2011 7:05 pm    Post subject:
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: 1013
Location: India

PostPosted: Thu Mar 24, 2011 10:10 am    Post subject:
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: 1226
Location: Israel

PostPosted: Thu Mar 24, 2011 2:08 pm    Post subject: Reply to: Comma separations between columns
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Combine columns without breaking words Indrajit_57 SYNCSORT 1 Sat Mar 19, 2016 9:33 am
No new posts 3 columns update Seppe DB2 2 Mon Jun 22, 2015 6:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us