Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
Copy semicolon delimited data

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

New User

Joined: 09 May 2005
Posts: 7

PostPosted: Thu Jul 05, 2007 2:25 am    Post subject: Copy semicolon delimited data
Reply with quote

I have my data in a semicolon-delimited format. I have to write this data in to some other file with out semicolons.

But there is a chance of not having data in some fields. In that case a semicolon will be placed in that field. for example

INPUTFILE: 123;231;1;abvc;;;32;

if you see in the above example
123 should go to field1 of output file
231 should to to field2 of ouput file
1 should go to field3 of ouput file
abvc should go to field4 of output file
space should go to field5 of output file
sapce should go to field6 of output file
32 should go to field7 of output file

finally my output file should look like

OUTPUT FILE:field1field2field3field4field5filed6filed7

OUTPUT FILE: 1232311abvc 32
Back to top
View user's profile Send private message

dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 05, 2007 2:46 am    Post subject:
Reply with quote


If you switch to cobol, you can do this with a very simple program that reads your delimited input and UNSTRINGs it into a fixed record format (i.e. copybook), then writes the fixed length records.

The unstring will also accomodate fields of inconsistent lengths.

Let me know if you want this topic moved to cobol.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 05, 2007 8:37 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for using DFSORT's PARSE and SQZ functions. The tricky part here is preserving a blank for each ;; value while not adding other blanks for the variable length values. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE and SQZ functions. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:



//SYSIN    DD    *
* Extract each field between the semicolons as a
* 10-character right-justified value.
* Build a record with the extracted fields.
* Replace each blank extracted field with a X'FF' character so
* we can preserve the blank fields.
   IFTHEN=(WHEN=(61,1,CH,EQ,C' '),OVERLAY=(61:X'FF'))
* Squeeze out the blanks - keep the X'FF' characters.
* Replace each X'FF' character with a blank.
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 Invalid XML character while producing... nikhil.bhole IBM Tools 0 Tue Mar 20, 2018 1:24 am
No new posts Get the list of data sets on DASD and... rakaitn JCL & VSAM 3 Thu Mar 08, 2018 12:38 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts Image copy after Online reorganization. lind sh IMS DB/DC 0 Tue Jan 30, 2018 9:58 pm
No new posts Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am

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