I have a Input file (RECFM = VB, LRECL = 400). It contains data as below
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2
***************************** Top of Data ******************************************************************************
${1:F01NWBKGB20CXXX1672607646}{2:O2020632100713}
${1:F01NWBKGB20CXXX1672607646}
$
{1:F01NWBKGB20CXXX1672607646}
{2:O2000632100713BBRUBEB0A0106227632601100}
{3:{103:EBA}
{4: :20:71F:USD95249751F}
${1:F01NWBKGB20CXXX1672607646}{2:O2050632100713BBR}
${2:O2000632100713BBRUBEB0A0106227632601100}
{5:{CHK:B58DE89F073C}
**************************** Bottom of Data ****************************************************************************
I need the output file (RECFM = VB, LRECL = 400)as below
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2
***************************** Top of Data ******************************************************************************
${1:F01NWBKGB20CXXX1672607646}{2:O2020632100713}
${1:F01NWBKGB20CXXX1672607646}
${1:F01NWBKGB20CXXX1672607646}{2:O2000632100713BBRUBEB0A0106227632601100}{3:{103:EBA}{4: :20:71F:USD95249751F}
${1:F01NWBKGB20CXXX1672607646}{2:O2050632100713BBR}
${2:O2000632100713BBRUBEB0A0106227632601100}{5:{CHK:B58DE89F073C}
**************************** Bottom of Data ****************************************************************************
Rule:
1.Each '$' symbol indicates the begining of a record.
2.Any number of rows between two '$' symbols must me joined to make a single row.
3. There should not be any spaces present between data when two rows are joined
Is there a limit to max. number of records between 2 $ symbols?
There is no limit to the max. number of records b/w two $ symbols. The max. number of records b/w two $ symbols i could see is 7. In some cases it is 5/3/2/4.
Quote:
Since your input is vb 400 and you are combining multiple records into single, your output is likely go beyond 400 bytes.
True. But, the max length i could see is only 55. Also the max. number of records b/w two $ symbols i could see is 7.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Why does someone believe these records need to be combined?
Hopefully, this "requirement" does not exist simply because there are developers who cannot process the multi-record data. The posted input data is completely usable to anyone who can write even rather simple code.
The actual input file i have contains more than 10 million records. I dont want my program to search for a string in that many rows. Thats the reason i need to combine the records that fall under a $ symbol. By doing so, i hope the run time will reduce a lot.
The actual input file i have contains more than 10 million records. I dont want my program to search for a string in that many rows. Thats the reason i need to combine the records that fall under a $ symbol. By doing so, i hope the run time will reduce a lot.
and you expect adding a sort step will reduce the time of your JOB ?
DFSORT too will have to process your 10 million records
Instead of double / multiple processing your file, why not finish it in one go in one program
it would be nice if people working in the same organization would coordinate their forum posting
in order to avoid duplicate posts on the same issue and wasting people time in replying to many posts when the issue is really ONE
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
The requirement actually exists and it does.
Because you don't want to write the code to use the file does not constitute a requirement.. . .
Why would you believe that copying 10 million records to save a bit of thought would reduce any run time. . . If this is to be an ongoing process, the wasted machine resources will be wasted many times - over and over. If this is propeerly implemented, there is no need to waste the time. . .
If there is any kind of proper review, this would not be accepted for promotion.
padhumainframe,
See if below jcl works for you...
I assumed that you can have maximum of 7 records between two $ symbols. Also I assumed max. record length of 60. You may adjust if they are different than my assumption.