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

Concatenate and Format input file/s contents into one output


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Wed Apr 15, 2009 10:08 am
Reply with quote

Hi all,

I am challenged with a scenario

I have two input files File 1 and File 2

File 1:
FB - Record length 10
Can have only one record

Code:
----+----1
AAAAAAAAAA


File 2:
can be FB or VB. The record length is different for each case ( file 2 can be of different lengths for each instance)
The file Can have multiple records

For example lets suppose the file is of length 20

Code:
----+----1----+----2
BBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDD
EEEEEEEEEEEEEEEEEEEE


Now I need to create an output file FB of length 8 which looks like this

Code:
----+---
AAAAAAAA
AABBBBBB
BBBBBBBB
BBBBBBCC
CCCCCCCC
CCCCCCCC
CCDDDDDD
DDDDDDDD
DDDDDDEE
EEEEEEEE
EEEEEEEE
EE')



I would appreciate if someone can provide some guidance on this ? possibly using ICETOOL?

Also Is there a solution where we can concatenate the record from file 1 with the records from file 2 one after other plus the ' and ) resulting in one single long record (in to some temporary intermediate file) before formatting it into records of length 7. I have other scenarios similar to this and that logic would very much help in coming up with a shareable solution.

Thanks in advance
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: Wed Apr 15, 2009 8:44 pm
Reply with quote

Given all of the variables in what you've described (and missing information such as the maximum number of records in file2), I would say that a DFSORT/ICETOOL solution would not be practical. I'd suggest you write a program instead. This kind of thing just doesn't scale up well with a SPLICE or WHEN=GROUP solution.
Back to top
View user's profile Send private message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Thu Apr 16, 2009 12:38 am
Reply with quote

Hi Yaeger,
Thanks for your response.

Unfortunately We are restricted to use a solution that is not based on custom COBOL/REXX programs. Hence I was trying to use ICETOOL.
Let me try to reduce the variables and unknowns in the problem so that we can hopefully find a DFSORT/ICETOOL solution

I can have four possible types of input file 2, each case depending on the value of column position 3 on file 1. I need the contents of file 2 only for first three case and for the fourth case the contents of file 2 can be ignore while preparing the output
Case 1: -
File 1:
FB - Record length 10
Can have only one record
Code:
----+----1
AA1AAAAAAA

File 2:
File 2 will be FB, Record lenth will be 12, and will have only one record
Code:
----+----1--
BBBBBBBBBBBB


I need the output to be like on a file of record length 8
Code:
----+---
AA1AAAAA
AABBBBBB
BBBBBB')


Case 2:
File 1:FB - Record length 10
Can have only one record
Code:
----+----1
AA2AAAAAAA

File 2:
For value '2' on column 3 of File 1:
File 2 will be FB, Record lenth will be 14 and will have two records
Code:
----+----1----
CCCCCCCCCCCCCC
DDDDDDDDDDDDDD


I need the output to be like
Code:
----+---
AA2AAAAA
AACCCCCC
CCCCCCCC
DDDDDDDD
DDDDDD')


Case 3:
File 1: FB - Record length 10
Can have only one record
Code:
----+----1
AA3AAAAAAA


File 2:
For value '3' on column 3 of File 1:
File 2 will be FB, Record lenth will be 16 and will have two records
Code:
----+----1----+-
EEEEEEEEEEEEEEEE
FFFFFFFFFFFFFFFF


I need the output to be like
Code:
----+---
AA3AAAAA
AAEEEEEE
EEEEEEEE
EEFFFFFF
FFFFFFFF
FF')


case 4:
File 1:
Code:
----+----1
AA4AAAAAAA


File 2:
File can be FB or VB of different record length
For value anything other than '1' ,'2' or '3' on column position 3 of File 1, ignore the contents of the file 2.
In this case I do NOT need the contents of file 2 in the output file
I need the output to be like
Code:
----+---
AA4AAAAA
AA')




Hope the above details are clear. Would it be possible to devise a solution out if this ?

Please let me know if you have any questions
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: Thu Apr 16, 2009 1:35 am
Reply with quote

Quote:
Unfortunately We are restricted to use a solution that is not based on custom COBOL/REXX programs.


Wow. Are you saying that you're not allowed to write programs no matter how complex the logic might be? I don't envy you. It might be possible to do this kind of thing with ICETOOL. It would probably involve generating control statements for handling file2 based on the indicator in file1. But it would be quite complicated and I don't have the time to code and test it for you. And if I did, what would you do when the requirements changed (as they always do)?
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: Thu Apr 16, 2009 2:48 am
Reply with quote

Hello,

Quote:
We are restricted to use a solution that is not based on custom COBOL/REXX programs.
Whose restriction? Why is custom code that you won't understand (ie some sort solution) more acceptable than code you write, debug, document and understand and have the ability to maintain without going for help? As Frank mentions, requirements do change often.

I suspect no user or client has any business reason that code should not be written. . . icon_confused.gif

Makes me wonder if someone "volunteered" with some comment like "we can do this with the sort" and now are stuck with this "rule" icon_rolleyes.gif
Back to top
View user's profile Send private message
ansnero

New User


Joined: 26 May 2006
Posts: 13

PostPosted: Thu Apr 16, 2009 3:28 am
Reply with quote

The restriction is with the project.. We do not write custom cobol/REXX code.. We use DataStage 390 (which has some limitations in complex file handling and processing) which generates cobol code. Now why its like that... I dont know... Anyhow.. appreciate your comments and 'concerns' .......
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: Thu Apr 16, 2009 3:45 am
Reply with quote

Hello,

What happens when there is a requirement that simply must have code written? Hopefully, there is some kind of exception consideration. . .?

Good luck icon_smile.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top