View previous topic :: View next topic
|
Author |
Message |
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
Hi all,
I am trying to append a trailer record at last of a PS using SYNCSORT.
I want the trailer in some specific manner-
Code: |
01 WS-TRAILER.
05 WS-TRAILER-ID PIC 9(02) VALUE 99.
05 WS-TRAILER-COUNT PIC 9(08).
|
Using SYNCSORT I am trying to append this record "9900000003" at the end of a PS.
My JCL for this is
Code: |
//TRAILER EXEC PGM=SYNCSORT
//SORTIN DD DSN=TEST.TESTING.TESTING.IN,DISP=SHR
//SORTOUT DD DSN=TEST.TESTING.TESTING.OUT,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=OUT,TRAILER1=(1:COUNT),REMOVECC,NODETAIL
/*
// |
Step1-- As a trial I just tried getting count from the input file into the output file...
But while doing so, my input records are not getting copied.I want to retain the input as it is and add count record at the last.
Also please explain me the above SORT CARD. I got it from the forum.
Quote: |
OUTFIL FILES=OUT,TRAILER1=(1:COUNT),REMOVECC,NODETAIL
|
Step2--Please guide me in getting the trailer ID also...and the output as given above---"9900000003"
I/P and O/P file--- LRECL=80 and FB |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi,
Remove the NODETAIL , It will give the records and count. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
TRAILER1 will by default create the output file as FBA thus adding 1 additional byte at the start of the output file.
The A in FBA is for ANSI carriage control character.
REMOVECC will remove the additional byte
NODETAIL - as you have founnd out, input records are not copied to output file.
Try this
Code: |
OUTFIL FILES=OUT,TRAILER1=(C'99',COUNT+1=(M11,LENGTH=8)),REMOVECC
|
Gerry |
|
Back to top |
|
|
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
Hi Bipin,
Thanks for a quick reply.....
That is working fine once I removed the NODETAIL.
But I got this output
Code: |
AAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
3
|
I want
Code: |
AAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
00000003
|
I mean instead of 7 spaces and then the count value...I need as suggested..
Also can you just explain me the terms used in the sort card---
REMOVECC,NODETAIL
And what if similarly I am trying to write a HEADER RECORD...with some constants "REPORT:..." will this work????? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Are you sure you have used edit mask shown by Gerry for count?
|
|
Back to top |
|
|
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
Ya
I have used it..As both the post were written at the same time so I did not know the solution at the time of posting my post..
It is working fine.
But then
what does it mean??? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Link Give by Dick is for DFSORT.
But as long as you want to understand only edit mask, you can use it.
I think it would be mostly same for both DFSORT and SYNCSORT, but I am not sure on this.
Best way would be looking at SYNCSORT manual and see what it says.. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
My bad,
I overlooked the topic title and failed to realize that this was a syncsort question. |
|
Back to top |
|
|
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
Thank you for a excellent solution.
This would help me a lot.
I tried out many options...
They are working fine..
Thanks Sambhaji and Dick |
|
Back to top |
|
|
|