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
 

 

Fileaid to create a tab/comma delimited file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
View previous topic :: :: View next topic  
Author Message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Fri Jun 28, 2013 9:32 am    Post subject: Fileaid to create a tab/comma delimited file
Reply with quote

Hi,

A question on FILEAID available options.

I have a mainframe sequential file (PS) and its corresponding copy book layout. The objective is to create a new sequential file with the fields separated by a tab/comma (the field definition is as per copybook) - so that the file can be ftped and end user able to import into excel.

As of now, we are using a sort card to insert tab/comma at desired positions - but we are having more and more files to do this and copy book changes have also happened needing to change sort cards.

Tried the xmlgen option and importing as xml table to excel. Wanted to check if there was a more easier option to generate a csv/tab delimited file.

Regards,
Aneesh.
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Jun 28, 2013 7:12 pm    Post subject:
Reply with quote

Hello,

One easy way is to clone the copybook inserting a filler with a value x'05' after each field. The new copybook would have a new name but all of the fields hae the names of the original. Then just do a move corresponding and all of the fields will be copied and the "new record" will have the tab delimeters.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Jun 28, 2013 7:12 pm    Post subject:
Reply with quote

This may seem useless to say, but I've really put some thought into this and can't think of a way.

The best I could come up with was to create a set of copybooks with that match the original, except with fields for the tab character inserted. Then use the File-Aid convert option.

The problem is, it's not much less work that what you're already doing.

I have a REXX that reads a formatted copybook print from FileAid for another purpose. You could write one like that and have it build your sort cards automatically. That would save some work. It's not fancy, and doesn't work with redefines or occurs.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sat Jun 29, 2013 2:40 am    Post subject: Reply to: Fileaid to create a tab/comma delimited file
Reply with quote

What your problem with xmlgen route?

If you generate symbols for your SORT from the COBOL copybooks, each time the copybook changes, and use them in your Sort Control Cards, then you have no changes to code when the copybook changes. Just submit, and it's done.

You could also use a huge STRING in COBOL.
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Sat Jun 29, 2013 10:00 am    Post subject: Reply to: Fileaid to create a tab/comma delimited file
Reply with quote

Thanks Dick, Ed and Bill for your suggestions.

Dick,
I would prefer not to create more copybooks as maintenance will become more.

Ed,
It definitely was not useless. Thanks for confirming there is no automagic option.

Bill,
XMLGEN output - importing the xmlfile to excel is not working (excel ends up hanging) when there are a lot of records (50000+ records). It works for small to medium sized files. Also, say there are 50 fields as per copybook definition, each record in input file gets split into 50 xml tag records in xmlgen output - causing increased ftp time and excel import issues for large files.

The option to create a sort card based on symbols from copybook seems a good option. I will give that a try.

Thanks all for your time and help.

Thanks,
Aneesh.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sat Jun 29, 2013 1:12 pm    Post subject: Reply to: Fileaid to create a tab/comma delimited file
Reply with quote

There is a sample REXX program to take a COBOL copybook and turn it into SORT symbols. Worth the effort to get it working.


Having included your symbols, copy them, chop them about with the editor (or REXX, or SORT) until you've got just a list of the names, starting after column one, with a trailing comma:

A-COMMA-DELIMITER,C','

Make a liine with

Code:
  A-COMMA-DELIMITER,


Put a C(opy) line command on that, and use AK line command on each of your actual data-name lines except the last,

[code] THIS-NAME,
THAT-NAME,
THE-OTHER-NAME [/code

So you get this:
[code] THIS-NAME,
A-COMMA-DELIMITER,
THAT-NAME,
A-COMMA-DELIMITER,
THE-OTHER-NAME [/code

Then just

[code]INREC BUILD=(THIS-NAME,
A-COMMA-DELIMITER,
THAT-NAME,
A-COMMA-DELIMITER,
THE-OTHER-NAME) [/code

And you're good-to-go. Re-generate the symbols when the copybook changes. Have the symbols in a PDS/PDSE. Submit each of the 40, 50, 93 SORTs each time. Nothing else to do, if you've been accurate with the timing of the generation.

Yes, it is simple enough to generate the SORT Control Cards as well.
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 -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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