MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Position Problem with TRAILER1

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Ram22
Beginner


Joined: 09 Jun 2004
Posts: 33
Topics: 6

PostPosted: Thu Apr 19, 2007 2:57 pm    Post subject: Position Problem with TRAILER1 Reply with quote

Hi,

I am trying the following sort statement.
Code:

SORT FIELDS=COPY                                                   
OUTFIL INCLUDE=ALL,                                                 
TRAILER1=(262X'FF',263:COUNT=(EDIT=(TTTTTTTT),LENGTH=8),271:191' ')


Can anyone pls tell me If I am correct or not!

What I am trying to do is:


    Copy the complete file(FB) to another(FB).
    This file will have a trailer record with
    The first 262 positions will be Highvalues
    Positions from 263 to 270, will have record count,
    From Position 271 the record will be padded with spaces.


The problem I am facing here is the record count is starting from 264 instead of 263

Can any one help me out with the reason why this is happening.

Regards & Thanks,
Ram
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Apr 19, 2007 3:11 pm    Post subject: Reply with quote

That's because TRAILER1 puts an ANSI carriage control character (e.g. '1' for eject) in position 1 by default, so your X'FF's start in position 2 and the count starts in position 264.

Add REMOVECC to your OUTFIL statement to suppress the ANSI carriage control character so the X'FF's will start in position 1 and the count will start in position 263.

Code:

   OUTFIL INCLUDE=ALL,REMOVECC,
      TRAILER1=(262X'FF',263:COUNT=(EDIT=(TTTTTTTT)))


Note that I cleaned up your TRAILER1 parameter a bit. You don't need ',LENGTH=8' after EDIT=(TTTTTTTT) - the 8 Ts in edit automatically give a length of 8. And you don't need the trailing blanks since DFSORT will pad with trailing blanks automatically.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 19, 2007 3:14 pm    Post subject: Reply with quote

Ram22,

When you use reporting features like trailer/header the output file attributes will be changed and will have a carriage control character. The lrecl will be increased by 1 bytes. You can supress the carriage control character with REMOVECC parm.

Quote:

The problem I am facing here is the record count is starting from 264 instead of 261


Why would your COUNT start at 261 when you are padding 262 bytes of high-values? If you really want the count to start at 261 then try these control cards

Code:

  SORT FIELDS=COPY                                                   
  OUTFIL REMOVECC,
  TRAILER1=(260X'FF',261:COUNT=(EDIT=(TTTTTTTT),271:191' ')


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ram22
Beginner


Joined: 09 Jun 2004
Posts: 33
Topics: 6

PostPosted: Thu Apr 19, 2007 3:42 pm    Post subject: Reply with quote

Thanks a lot Frank and Kolusu.
Kolusu,
Just to clarify,
In the I posted
The problem I am facing here is the record count is starting from 264 instead of 263

not 261

Any ways thanks both for the information. This is of great help to me.

Ram
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group