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
 

 

Split File into multiple records.

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

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Apr 09, 2014 1:54 pm    Post subject: Split File into multiple records.
Reply with quote

Hi,

I have an operation to be perfomed on a file of 80 bytes length. This file has continuous data. Need to split the data in a file of 150 length based on a character "/".

For example my file looks like

Code:
A123465/B123/C12346567890/
D1234567890123456/E123456
7890/


The output of the above should be

Code:

A123456
B123
C1234567890
D1234567890123456
E1234567890


Please let me know if we can do this by sort.

Thanks
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 09, 2014 2:21 pm    Post subject:
Reply with quote

Can the input be like

Code:
A123465/B123/C12346567890/
D1234567890123456/E1
23
4
5
6
7
8
9
0
/
/
/
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Apr 09, 2014 2:39 pm    Post subject: Reply to: Split File into multiple records.
Reply with quote

Hi,

No. The input will be continuous until 80 byte and then go to next line.

Thanks
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 09, 2014 5:08 pm    Post subject:
Reply with quote

1.What is the length between two '/'?
2.Can there be space in value which between two '/'

like

Code:
/pandora box/

3. How many '/' will be present in a single record?
4.Will a value always end with '/'?
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Apr 09, 2014 5:36 pm    Post subject: Reply to: Split File into multiple records.
Reply with quote

The length between two "/" can vary.
There cannot be a space between two "/", Also there can never be a scenario like "//".

Thanks.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 09, 2014 6:17 pm    Post subject:
Reply with quote

Can you answer this
1.How many '/' will be present in a single record?
2.Will a value always end with '/'?
3.Will value exceed the length of 80?
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Wed Apr 09, 2014 7:37 pm    Post subject: Reply to: Split File into multiple records.
Reply with quote

Hi,

1.How many '/' will be present in a single record?
--> There can be None to more than one on each record.
2.Will a value always end with '/'?
--> Yes
3.Will value exceed the length of 80?
--> Yes, it can exceed length of 80
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Apr 09, 2014 7:40 pm    Post subject:
Reply with quote

What is the length of the output file?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 10, 2014 12:09 am    Post subject: Reply to: Split File into multiple records.
Reply with quote

muffirulz wrote:
I have an operation to be perfomed on a file of 80 bytes length. This file has continuous data. Need to split the data in a file of 150 length based on a character "/".



So which one is true ? is your input file 150 bytes in length or 80 bytes in length? What is the RECFM of the INPUT file?

muffirulz wrote:

1.How many '/' will be present in a single record?
--> There can be None to more than one on each record.


From your sample input it is evident that you want combine 2 records that are broken across records.

For example assuming your LRECl=80 and you have a string without "/" all the way upto 80 bytes. Now do you need to combine this record with the next record till it finds the "/" If you do want that done, aren't you going beyond the record length for each string?

muffirulz wrote:
The input will be continuous until 80 byte and then go to next line.


what is the maximum number of records that would not have a "/" ? what if you have 409+ records like that, how are you planning to merge them altogether into a single record as merging them as a single record will exceed the Maximum allowable record length of z/OS
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Thu Apr 10, 2014 10:36 am    Post subject: Reply to: Split File into multiple records.
Reply with quote

Hi,

The Input File is of 80 bytes and the output file will be of 150 bytes. The recfm is FB.

Yes. If a string goes to the second line in between two delimiters '/', then I need to combine both the strings and put it in the file of 150 bytes. There wont be a scenario when I will have the toptal length of the string between two delimiters '/' to be more than 120 bytes. Therefore it wont be more than 2 - 3 lines of 80 bytes.

Hope the above explanation helps.

Thanks.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 10, 2014 10:51 pm    Post subject:
Reply with quote

muffirulz,

It can be done in DFSORT, however it would require 2 passes of data.

1. Resize with parse
2. Copy for merging the broken strings together.

On the other hand a simple COBOL program with PERFORM Varying will give you the results with a single pass of data quite easily. So I suggest that you write a program to get the results rather than relying on DFSORT with 2 passes of data.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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