Joined: 13 Oct 2005 Posts: 84 Topics: 32 Location: INDIA
Posted: Thu Oct 13, 2005 6:01 am Post subject: how to add a string in outrec using syncsort
hi,
i have a input file as below
-------------------------------------
H bbbbbb xxxxxx yyyyyy
d zzzzzzz zzzzzz
d aaaaaaaaa aaaaa
.
.......
T 000044455
-------------------------------
here i want to add some part of the header record with each detailed record as below
---------------------------------
d xxxxxx zzzzzzz zzzzzz
d xxxxxx aaaaaaaaa aaaaa
.
.......
----------------------------------------
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Oct 13, 2005 6:04 am Post subject:
js01,
This information is not sufficient. Please provide the following details.
1. LRECL & RECFM of your input file.
2. How many header-data-trailer sets do you have in your file ? (will there be multiple header-deta-trailers ???).
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Oct 13, 2005 10:08 am Post subject:
Phantom,
It would be good idea to use STOPAFT instead of a INCLUDE COND in the first copy pass. if by any chance you have more than 1 record with 'h' in the first byte , your job will abend. since you are looking just for a single header record you can just use STOPAFT.
Also I see that you use c' ' to allign the dynamic sort control cards. you can use nx to create the spaces. Also you don't have to code 80:x on every line
on the other hand I think using SYMBOLS is good idea. Using symbols will give lot of flexibility in terms putting the header any where on the output record.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
H BBBBBB XXXXXX YYYYYY
D ZZZZZZZ ZZZZZZ
D AAAAAAAAA AAAAA
T 000044455
//SORTOUT DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
OPTION STOPAFT=1
SORT FIELDS=COPY
OUTREC FIELDS=(C'HEADER-INFO,C',
C'''',
10,6,
C'''',
80:X)
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&T1,DISP=OLD
//SORTIN DD *
H BBBBBB XXXXXX YYYYYY
D ZZZZZZZ ZZZZZZ
D AAAAAAAAA AAAAA
T 000044455
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,09,HEADER-INFO,16,25)
/*
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Fri Oct 14, 2005 12:18 am Post subject:
Hi Kolusu,
Quote:
It would be good idea to use STOPAFT instead of a INCLUDE COND in the first copy pass.
This is really a nice suggestion. Though he says that he has only one header, we just have to be sure that the job does not abend even in extreme conditions. Thanks a lot.
Quote:
on the other hand I think using SYMBOLS is good idea
Hmm....I never tried using SYMBOLS. As you know, my previous shop had Syncsort v 3.7 which does not support most of the features. Got to try out different options ATLEAST NOW. Thanks for the idea.
Also, we need to know what version of sort js01 has.
JS01,
What version of sort do you have ??? Just code a dummy sort step (PGM=SORT) and go to the sysout and paste the first line sysout which contains the version (Note: Don't use PGM=SYNCTOOL).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum