Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7314

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: 7314

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 Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us