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
 

 

Add delimiters in a fixed length record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 39
Location: United States

PostPosted: Fri Mar 27, 2015 3:49 am    Post subject: Add delimiters in a fixed length record
Reply with quote

Hi

Need help on adding a delimiter using DFSORT. I have multiple record types like '001' ,'002', '003' and each record types have multiple positional fields. I will have to add a delimiter between each field. Appreciate any help

Input
-------
001123456789101 11 20150323
002123456789101 11 123456789012
003123456789101 11 123456789012
002123456789101 11 123456789012
003123456789101 11 123456789012

Output
--------
001;123456789101;11;20150323
002;123456789101;11;123456789012
003;123456789101;11;123456789012
002;123456789101;11;123456789012
003;123456789101;11;123456789012
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Mar 27, 2015 3:58 am    Post subject: Reply to: Add delimiters in a fixed length record
Reply with quote

Just a COPY operation with INREC IFTHEN=(WHEN=(logical expression),BUILD=. Consult the manuals, look for examples here.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 39
Location: United States

PostPosted: Fri Mar 27, 2015 8:07 pm    Post subject: T
Reply with quote

Thanks Bill. I'm trying to find an example but could not find one I was expecting. Can you give me an example?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Mar 27, 2015 9:05 pm    Post subject: Reply to: Add delimiters in a fixed length record
Reply with quote

Look for something like this:
Code:

 OPTION COP?Y


or
Code:

 SORT FIELDS=COPY


That will do the COPY operation.

Then something like this, for the IFTHEN and the formatting.

Code:

 INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'001'),
                 BUILD=(1,3,
                        C';',
                        4,12,
                        C';',
                        16,2,
                        C';',
                        19,8
                        80:X)),
       IFTHEN=(WHEN=NONE,
                 BUILD=(1,3,
                        C';',
                        4,12,
                        C';',
                        16,2,
                        C';',
                        19,12
                        80:X))
.


That's assuming fixed-length 80-byte records.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 39
Location: United States

PostPosted: Fri Mar 27, 2015 9:52 pm    Post subject:
Reply with quote

This works. Thanks Bill.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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