Page 1 of 1

Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 3:48 pm
by maheswaran37
I have a sort card which looks like this.

OPTION COPY
OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
BUILD=(80X),
TRAILER1=('DATCT,''',COUNT-1=(EDIT=(TTTTTT)),'''')
OUTFIL FNAMES=T1,
OVERLAY=(35:SEQNUM,8,ZD)

OPTION COPY
INREC IFOUTLEN=34,
IFTHEN=(WHEN=(35,8,ZD,EQ,1),OVERLAY=(9:DATCT))

This is currently writing the record count in the Header starting from 9th position and ending at 14 position. After the record count, it is all SPCAES till the end of the record. Now, the requirement is that i need only 2 SPACES after the record count (Only in the Header record) and the rest should be FILLERS. The LRECL of the file is 34. Also, there is no record type to distinguish between the header and detail records. There is no trailer record too.

Example:
10020811000005
1301081110035887S0463 00002000
2301081110035887S0438 00200510

Thanks for your help!!!

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 7:03 pm
by NicC
What character do you want as filler if you do not want spaces?

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 7:16 pm
by maheswaran37
The Header record should end after the record count and the 2 SPACES.

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 8:57 pm
by BillyBoyo
The you need to chop the length of your header to 20 (which includes the RDW), assuming that I've guessed 16 for the characters you want correctly. You do the counting.

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 9:40 pm
by maheswaran37
Yes Billy you are correct. I need the length of my header to be 16.

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 11:16 pm
by Frank Yaeger
There's an essential piece of information missing here:

What is the RECFM and LRECL of the input file?

What do you want for the RECFM and LRECL of the output file?

Re: Truncating SPACES in the Header Record

PostPosted: Wed Aug 03, 2011 11:28 pm
by maheswaran37
Input file:
RECFM = FB
LRECL = 34

Output File:
RECFM = FB
LRECL = 34

Re: Truncating SPACES in the Header Record

PostPosted: Thu Aug 04, 2011 1:04 am
by Frank Yaeger
Output File:
RECFM = FB
LRECL = 34


The Header record should end after the record count and the 2 SPACES.


I need the length of my header to be 16.


You can't get there from here! Your requirement makes no sense.

For a RECFM=FB and LRECL=34 file, EVERY record must have 34 bytes! So you can have blanks as fillers or binary zeros as fillers or a mixture of fillers, but you the header length will be 34 bytes (not 16) regardless.

If you tell us what you really want the header record to look like (all 34 bytes of it), then we can help you.

Re: Truncating SPACES in the Header Record

PostPosted: Thu Aug 04, 2011 3:12 am
by maheswaran37
It is fine if the remaining of the header record is filled with blanks. So my file will look like

10020811000002(2 SPACES)(18 BLANKS)
1301081110035887S0463 00002000
2301081110035887S0438 00200510

Thanks very much for your help with this.

Re: Truncating SPACES in the Header Record

PostPosted: Thu Aug 04, 2011 3:51 am
by Frank Yaeger
You can just change your INREC to:

  INREC IFOUTLEN=34,                                 
    IFTHEN=(WHEN=(35,8,ZD,EQ,1),OVERLAY=(9:DATCT,20X))