IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Format to pipe delimited with variable field length


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Wed Sep 14, 2016 2:48 pm
Reply with quote

Hi,
I have a file (FB). But value in each field can have variable length (like name, address etc). I need a O/P with pipe delimited.

I/P:
Code:

fname1      addr1     city1
fname11    addr11    city11
fname111   addr111  city111


Required O/P:
Code:

fname1|addr1|city1
fname11|addr11|city11
fname111|addr111|city111


Thanks,
PS[/code]
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Sep 14, 2016 3:33 pm
Reply with quote

Quote:
I have a file (FB)

No you do not - you have a data set.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Wed Sep 14, 2016 3:35 pm
Reply with quote

Yes. Data set
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 14, 2016 4:28 pm
Reply with quote

You have provided very less information to help. What is the Input/Output record format & record length. What could be the maximum length of any field. Your data might have embedded spaces in name/address fields like:
Code:
First Name Last Name ABC ROAD NEW DELHI


Search using key words PARSE, BUILD, SHIFT, SQZ. You will find many examples to start with.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Wed Sep 14, 2016 4:37 pm
Reply with quote

Hi,
Here is some more information.

I/P & O/P record format is "FB"
record length is 310 bites

Code:

Field                  Max length
First name         30
Address            250
City                  30
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 14, 2016 4:57 pm
Reply with quote

So the Address filed will always start at col 31 and City will always start from col 281?

Name/Address/City fields can have spaces in them?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Sep 14, 2016 5:48 pm
Reply with quote

It is as simple as making a tea. You would have to search on what Mistah suggested and TRY and next time try to provide the least minimal information to the problem together when you post than feeding a piece meal.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top