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

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

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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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