Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add Trailer Record with count in a PS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Add Trailer Record with count in a PS
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Apr 29, 2010 3:24 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 5:57 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 6:14 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us