IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Add Trailer Record with count in a PS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 2:55 pm
Reply with quote

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
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Apr 29, 2010 3:14 pm
Reply with quote

Hi,
Remove the NODETAIL , It will give the records and count.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Apr 29, 2010 3:24 pm
Reply with quote

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
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 3:27 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 5:26 pm
Reply with quote

TS70363
wrote:
I want

Are you sure you have used edit mask shown by Gerry for count?
Code:

M11,LENGTH=8
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 5:32 pm
Reply with quote

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
Code:
M11,LENGTH=8
what does it mean???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 5:57 pm
Reply with quote

Table 43. Edit Mask Patterns
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 6:02 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 6:14 pm
Reply with quote

My bad,
I overlooked the topic title and failed to realize that this was a syncsort question.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Apr 29, 2010 7:03 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top