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

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

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
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

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