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 position, start pos, length of column... juares castro SYNCSORT 14 Fri Jun 21, 2019 8:47 pm
No new posts how to add date & timestamp to th... dharmaraok DFSORT/ICETOOL 5 Thu Apr 18, 2019 2:45 pm
No new posts files whose record count varies with ... janmejay CA Products 0 Fri Mar 08, 2019 9:35 pm
No new posts from CSV to fixed Ron Klop DFSORT/ICETOOL 7 Thu Feb 07, 2019 8:10 pm
No new posts calculate the record count and based ... naveensrimf DFSORT/ICETOOL 1 Tue Jan 08, 2019 11:20 pm

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