|
View previous topic :: View next topic
|
| Author |
Message |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
| Code: |
//*
//ICETOOL1 EXEC PGM=SYNCTOOL
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=&TRS.SEQ.AU.MASTER.VEND,DISP=SHR
//IN2 DD DSN=&TRS.SEQ.AU.AU2100.OUTREC.SORT,DISP=SHR
//OUT DD DSN=&TRS.SEQ.TEST1.AU2100.BASE,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(50,50),RLSE)
//T1 DD DSN=&TRS.SEQ.TEST1.AU2100.TEMP01,
// DISP=(MOD,CATLG,DELETE),
// SPACE=(CYL,(50,50),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,6,CH) WITH(32,166) WITHALL
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,31,32:166X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1,166,167:1,31)
/*
//*
|
Output is coming without any abend, data format is not correct. Please let me know where it is wrong.
Output data is as follows:
1-31 bytes - 2nd file data
32-166 bytes - first file data
1-31 - first file data displaying at the end means after 167th byte
I need the output as follows:
Second file has to display with 31 bytes, then first file should be concatenated and should be displayed from 32nd position till 197 position |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Girija
This looks amazingly similar to the problem we solved yesterday. What are you doing that is different ? |
|
| Back to top |
|
 |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
I am not denying that...
But the output should be as follows:
second file having LRECL = 31
First File having LRECL = 166
What happening in the output is as follows:
Output LRECL = 200
Second file data is displaying for the first 31 bytes - that is fine with me
First File data having 166 bytes of data. In that, first 31 bytes displaying at the end of the output file(from 167 to 197th position) but it is supposed to display from 32nd position in the output file, hence i am not getting the format I required.
Remaining data should display after this.
Only Problem I am facing first file data that to 31 bytes, it was supposed to display from 32 position , displaying from 167 position.
I know I made some mistakes in declaring OUTREC fields, but I am not getting what is the mistake i have done.
Sortparm are as follows:
TSPDS.SORTPARM(TPSORT06) -
***************************
OUTREC FIELDS=(1,31,32:166X)
**************************
TSPDS.SORTPARM(TPSORT07) - 01.
****************************
OUTREC FIELDS=(1,166,167:1,31)
****************************
TSPDS.SORTPARM(TPSORT08)
----------------------------------------
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,6,CH) WITH(32,166) WITHALL
Please let me know any mistakes, done while defining OUTREC fields? |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This is how we redefined the shorter records yesterday, and your code does not look like what is coded here.
| Quote: |
I think it may have to do with the 115 byte record. It looks as though your OUTREC may be incorrect.
The code below is coded from memory so may need a little tweak, but this is how I see it-
1,115 = original 115 byte record
385X = 385 spaces to build up to 500 bytes
1,115 = append original record after spaces
OUTREC=(1,115,385X,1,115) |
|
|
| Back to top |
|
 |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
ya, this is a different case.
First File contains lesser record length compared to second file. I come to know if the second file is having shorter records.
In this scenario,
First File having LRECL-31
Second File LRECL-166
Earlier we discussed with
First File LRECL- 500
Second File LRECL-115
If second file having more LRECL, then how to defined OUTREC in TPSORT07
Currently i have defined as follows:
TSPDS.SORTPARM(TPSORT07)
****************************
OUTREC FIELDS=(1,166,167:1,31)
****************************
By giving this , data formatting not displaying properly. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Take avery close look at what we did on Tuesday.
With the shorter record we added the correct number of blanks to make the record length the same as the longer record, and then what did we do with the original shorter record ?
And for the longer record what did we do, we did not take the first 31 bytes of this record and stick it on the end .................... did we ? SO what did we put on the end of this record ? |
|
| Back to top |
|
 |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
IF the first file is longer than second file, then we can adjust the second file, hence data format would be fine.
But now in the second scenario, first file having lesser compared to first one. Hence not getting the format I required.
If I match second file length by comparing first file, here it won't work and even I can't give Banks here as you know second file containing full 166 bytes of data, but some how not getting the format I REquired.
Output file conatining 200 Bytes....
in the out file - getting data format as below:
1-31, 31 bytes from second file
32-166, first file data starting from 32nd byte
167-197, first file data starting from 1st byte
What I need is ...
1-31, 31 bytes from second file
32-197, first file data starting from 1st byte
Now i think My question is clear to everybody.... |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| The problem as far as I can see is exactly the same as the one that was resolved on Tuesday, just with different record lengths. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
FILE2 - Increase from 31 to 31 + 166 BLANKS.
FILE1 - Pos 1-6, the key, leave as is, BLANKS in pos 7 - 31, pos 32 = 166 bytes of original FILE1 record.
Not sure if the order of the records in T1 can affect the result, but I would try by swapping the order in which the records are written to T1, doing the shorter ones first. May not affect it, let me know what happens. |
|
| Back to top |
|
 |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
If I specify outrec fields mentioned as above, getting data format issue,
please can you let me know what I need to specify. |
|
| Back to top |
|
 |
Girija
New User
Joined: 29 Jul 2005 Posts: 14 Location: Mysore
|
|
|
|
Hi,
I tried as per the positions mentioned below:
FILE2 - Increase from 31 to 31 + 166 BLANKS.
FILE1 - Pos 1-6, the key, leave as is, BLANKS in pos 7 - 31, pos 32 = 166 bytes of original FILE1 record.
------------------
FILE2 - Increase from 31 to 31 + 166 BLANKS. - this is fine
FILE1 - Contains all 166 bytes of original FILE1 record, hence i speicify Blanks from 7-31, then in the output it displays Blanks and loosing 25 bytes of data |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| I was saying that you move the 166 byte record along to position 32 so that it gets spliced with the 31 bytes of the file2 record. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|