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

How to make a sequential file delimited with some character?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Chennai

PostPosted: Fri Jun 08, 2007 4:24 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 08, 2007 7:48 pm
Reply with quote

Hello,

You can do what you want using STRING with a bit of COBOL code.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jun 09, 2007 9:55 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jun 10, 2007 6:24 am
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Jun 10, 2007 8:23 pm
Reply with quote

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
View user's profile Send private message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Chennai

PostPosted: Tue Jun 12, 2007 6:08 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jun 12, 2007 8:52 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 12, 2007 9:39 pm
Reply with quote

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
View user's profile Send private message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Chennai

PostPosted: Wed Jun 13, 2007 4:54 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 6:13 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top