Truncating SPACES in the Header Record



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Truncating SPACES in the Header Record

Postby maheswaran37 » Wed Aug 03, 2011 3:48 pm

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!!!
maheswaran37
 
Posts: 10
Joined: Wed Sep 15, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Truncating SPACES in the Header Record

 

Re: Truncating SPACES in the Header Record

Postby NicC » Wed Aug 03, 2011 7:03 pm

What character do you want as filler if you do not want spaces?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Truncating SPACES in the Header Record

Postby maheswaran37 » Wed Aug 03, 2011 7:16 pm

The Header record should end after the record count and the 2 SPACES.
maheswaran37
 
Posts: 10
Joined: Wed Sep 15, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Truncating SPACES in the Header Record

Postby BillyBoyo » Wed Aug 03, 2011 8:57 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Truncating SPACES in the Header Record

Postby maheswaran37 » Wed Aug 03, 2011 9:40 pm

Yes Billy you are correct. I need the length of my header to be 16.
maheswaran37
 
Posts: 10
Joined: Wed Sep 15, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Truncating SPACES in the Header Record

Postby Frank Yaeger » Wed Aug 03, 2011 11:16 pm

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?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Truncating SPACES in the Header Record

Postby maheswaran37 » Wed Aug 03, 2011 11:28 pm

Input file:
RECFM = FB
LRECL = 34

Output File:
RECFM = FB
LRECL = 34
maheswaran37
 
Posts: 10
Joined: Wed Sep 15, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Truncating SPACES in the Header Record

Postby Frank Yaeger » Thu Aug 04, 2011 1:04 am

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.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Truncating SPACES in the Header Record

Postby maheswaran37 » Thu Aug 04, 2011 3:12 am

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.
maheswaran37
 
Posts: 10
Joined: Wed Sep 15, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Truncating SPACES in the Header Record

Postby Frank Yaeger » Thu Aug 04, 2011 3:51 am

You can just change your INREC to:

  INREC IFOUTLEN=34,                                 
    IFTHEN=(WHEN=(35,8,ZD,EQ,1),OVERLAY=(9:DATCT,20X)) 
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post