View previous topic :: View next topic
|
Author |
Message |
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
Hi! I need to do the following.
Copy the contents of a record and append it to the previous record, Then Delete the current record.
HERE is what I need to do. The Records are in a PS dataset.
Input:
REC1: ABCD EFGH IJK
REC2: LMNO PQRS
Output:
REC1: ABCD EFGH IJKLMNO PQRS
Can someone help me out. Can we do this with FILEAID. If I could run the FILEAID with a JCL, that would be great.
Thanks. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
Can we do this with FILEAID |
Is FILEAID a requirement?
Quote: |
If I could run the FILEAID with a JCL |
Can it be done in an interactive session? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Is there some reason the solution must be FileAid?
There are examples of doing just this with sort already posted n the forum. . . Use SEARCH above. . . |
|
Back to top |
|
|
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
No Fileaid is not a requirement. Any utility will do as long as I can use it in a JCL. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
arbinddobhal wrote: |
No Fileaid is not a requirement. Any utility will do as long as I can use it in a JCL. |
Sort should do this just fine.
What sort do you have?
What level/release/PTF/etc is the sort?
What is the recfm & recsize of the input file?
What is the desired recfm & recsize of the output file? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
You should look in to famous 'Smart Dfsort Tricks' pdf by Frank.
Then find the topic combine multiple records in to one.
You could also take a look at TF (Text flow) line command which can be used for such requirements. |
|
Back to top |
|
|
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
What sort do you have? SORT, SYNCSORT
What level/release/PTF/etc is the sort? SYNCSORT on Z/os 1.3.0
What is the recfm & recsize of the input file? : Recfm: FB, Rec Legnth: 407
What is the desired recfm & recsize of the output file? RecFM: FB, Rec Legnth : 407
Thanks!![/b] |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
arbinddobhal,
Show a sample input which covers all possible combinations of real input data. Will you have only 2 records in the input file always? If not, are you trying to combine 1st record and the 2nd, 3rd and 4th, 5th and 6th and so on?
arbinddobhal wrote: |
What is the recfm & recsize of the input file? : Recfm: FB, Rec Legnth: 407
What is the desired recfm & recsize of the output file? RecFM: FB, Rec Legnth : 407 |
From whatever you have written in your initial post, your output file should be having double the input LRECL. How can it be the same? |
|
Back to top |
|
|
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
Arun,
Thanks for the reply. Here is the whole problem.
I have a huge file which usually has 90,000 Records in it. Sometimes there are records which should be part of the previous record. I need to find the records which are split into two records and then combine them into one. I can put a fileaid step in a JCL to find the split records but I am not sure what I should do to combine them.
Thanks,
Arbind |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I need to find the records which are split into two records and then combine them into one |
How do you plan to identify these records? Still it does nt look clear.
Unless you show some "real"istic data, it's difficult for somebody to make out what you are dealing with. |
|
Back to top |
|
|
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
Arun,
The first record of these records are always a special Char. So I can easily find them. All I need is a away to concatenate the record to previous record and then delete the current record.
Thanks,
Arbind |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
The first record of these records |
|
|
Back to top |
|
|
arbinddobhal
New User
Joined: 26 Mar 2010 Posts: 6 Location: St Paul
|
|
|
|
I meant the first Character of these split records is always a special character. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
a special character |
Which special character? Still you did not answer how the splitted and the combined records have the same length of 407. You can post some sample input records and the expected output out of it using the "Code" tags. You cannot expect somebody to help you out if you are not willing to post any useful info. |
|
Back to top |
|
|
|