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

How to split the record based on some keys?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sat Aug 11, 2007 6:40 pm
Reply with quote

Hi All,

I have a requirement. i need to split a record (having 254 characters) if any of the following case occurs.
1) After every 90 characters
2) There is a set of strings say 'XYZ', 'ABC', 'PQR' etc.
At any ocurance of a perticular string say 'XYZ' , from this set of strings.

If the record breaks due to 2nd reason then the new sentence has to begin from the foresaid string. i.e. i have to retain the string in the beginning of the new line.

Please help.....

Vinay
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Aug 11, 2007 10:31 pm
Reply with quote

Hello,

Please post some sample input data and the expected output from that data.

Also, please include the recfm and lrecl of the both the input and output files. You mentioned 254 and 90 characters, but clarificatoin will help.
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sun Aug 12, 2007 1:50 am
Reply with quote

Hi,
Thanks for response
I would give a sample of input and expected output.
Case1:
Input can be:
World is a beautiful place.....<90 char>Save the planet earth....<90 char>Good morning...<30 char>
Expected output:the above line string should be split in three lines as follows.
World is a beautiful place.....<90 char>
Save the planet earth....<90char>
Good morning...<30 char>

Case2:
Input can be:
World is a beautiful place XYZ save the planet earth ABC Good morning.
Expected output:
World is a beatuiful place
XYZ save the planet earth
ABC Good morning.

recfm is FB for both input and putput and lrecl is 254 for input and 90 for output.

I think i am making my point clear.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sun Aug 12, 2007 5:24 am
Reply with quote

In the Sort control card you can use / character to write input record into multiple lines.
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Sun Aug 12, 2007 8:16 am
Reply with quote

Hi,

Devzee wrote:
In the Sort control card you can use / character to write input record into multiple lines.


This is not clear to me. can you please elaborate. an example will help. Moreover i have to split the records on basis of some strings also.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sun Aug 12, 2007 8:41 pm
Reply with quote

Quote:
I think i am making my point clear.


No, you're not. It's not clear when you want to use which rule, what the actual set of strings is, whether case1 and case2 are two different input files each with its own rules, or one input file with different sets of rules. Also, for case 1 you show the output as 90/90/30, but it would actually have to be 90/90/90 with the third record padded with blanks on the right.

Case 1 as shown could be done with these DFSORT control statements:

Code:

   OPTION COPY
   OUTFIL BUILD=(1,90,/,91,90,/,181,30)


Case 2 could probably be done with DFSORT's PARSE function, but how you would do it depends on the full set of rules and strings. For more information on DFSORT's PARSE function, see:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
vinay upadhyay

New User


Joined: 13 May 2007
Posts: 14
Location: chennai

PostPosted: Mon Aug 13, 2007 10:23 pm
Reply with quote

Hi,

The 2 cases can be in the same input file.That is to say there can be two kind of records in the inputs file.

Frank Yaeger wrote:

Also, for case 1 you show the output as 90/90/30, but it would actually have to be 90/90/90 with the third record padded with blanks on the right.


This is correct.

Now there is change in the requirment.ppl want us to implement the logic in a pre existing program rather than using a sort step (which we thought of doing earlier).

How can we do it in a cobol pgm?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Aug 13, 2007 11:01 pm
Reply with quote

I'm closing this thread. Please start a new thread in the COBOL Forum.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top