View previous topic :: View next topic
|
Author |
Message |
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
Hi,
I have a VSAM which I converted into a sequential file. I want to make each& evry field of this file delimited with some character( say comma(,)).
Can I do the same using JCL( I mean some utility like DFSORT). But the file is too large to be handled by DFSORT, that it contains more than 500 fields.
Thanks,
Reni |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You can do what you want using STRING with a bit of COBOL code. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can I do the same using JCL( I mean some utility like DFSORT). But the file is too large to be handled by DFSORT, that it contains more than 500 fields. |
Why do you assume that's too large for DFSORT to handle?
Show an example of your input records and what you want for output. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Kind of thinking out loud, but i'd not want to have to code the displacements of 500 fields as well as the displacements for each delimiter character. Not only would that take a lot of time and be quite error prone, but it would need to be re-done if a field that occurred early in the record had a length change or if there was a field addition or deletion.
Using the copybook, the STRING statement could be built quickly by simple editing commands and no time would be spent typing all of the "fields" start, length, type, etc. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
the STRING statement could be built quickly by simple editing commands and no time would be spent typing all of the "fields" start, length, type, etc. |
You can use DFSORT Symbols to avoid typing the start, length, type, etc as well. We even have a REXX available that can convert COBOL copy books to DFSORT symbols. See the "Create DFSORT Symbols from COBOL COPYs" Smart DFSORT Trick at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
Hi
Actually I am doing a conversion of an existing VSAM file into a DB2. That means it is a 1 time run & no further change in the length of the filed will effect the piece of code if it is written in JCL using DFSORT.
So you are telling me that DFSORT itself can be used for the same if we could generate the symbols using the REXX program, right? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can try using DFSORT control statements something like this:
Code: |
OPTION COPY
INREC BUILD=(Symbol1,C',',
Symbol2,C',',
Symbol3,C',',
...
Symbol500)
|
where Symbol1-Symbol500 are the DFSORT Symbols for your fields. hat might be too many fields or it might not - the only way to know is to try it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might just repro the data from vsam and directly load it into db2. The db2 load does not require delimiters iirc. . .
It supports delimiters, but should work with fixed data ase well. . . |
|
Back to top |
|
|
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
Hi dick,
As you said, Can we directly load the data into the DB2 table without a delimiter?wont it create any problems on the table side?I want to confirm it.
Thanking you,
Reni |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As long as the fixed length data in the repro'd file matches the definitions of the db2 columns, you should be ok. |
|
Back to top |
|
|
|