View previous topic :: View next topic
|
Author |
Message |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
I have a pipe-delimited file of lrecl 502.Can I add a pipe-delimited header row of length =742 and write it into an output file(length =742). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm not sure if you're talking about a header generated with HEADERx or a header from somewhere else. But if you want to create a file with LRECL=742 from a file with LRECL=502, you just have to ensure that the output records are 742 bytes long.
For example, you could pad the 502 byte records with blanks to 742 bytes with OVERLAY in INREC, OUTREC or OUTFIL, e.g.:
Code: |
OUTREC OVERLAY=(742:X)
|
If that doesn't help, then please explain what you're trying to do in more detail. Examples would help. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Code: |
PRDN|CRP|SDIV|STA|POSN|DSC|CLAS|PRG|STYN|CTRCD|CLRCD|------> header(742 length)
327165045|01| |4| 000933650|SF FLAT FRONT BARKK--->filtered data(502 length)
467973035|01| |4| 000985854|EVERYDAY KHAKIWTRGCNGR
468125025|01| |4| 000899592|BAS CRGO SHORTSWAMPOLI
|
Code: |
INCLUDE=(12,2,CH,EQ,C'0....
HEADER1=('PRDN|CRP|SDIV|STA....
|
I am using HEADER1=('PRDN|CRP|SDIV|STA......') in the sortcard which I guess can have only upto 255 bytes in it.I want the header and the data rocords
in one file of 742 length.
Thanks,
Arun |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I am using HEADER1=('PRDN|CRP|SDIV|STA......') in the sortcard which I guess can have only upto 255 bytes in it |
Where did you get that idea? HEADERx can have more than 255 bytes. A single constant for HEADERx can have a maximum of 256 characters, but you can have multiple constants.
I think you want something like this:
Code: |
OPTION COPY
OUTFIL INCLUDE=(12,2,CH,EQ,C'0....),
OVERLAY=(742:X),
HEADER1=('constant1...',
'constant2',
...)
/*
|
Note that you will actually have to break the 742 character constant into multiple constants each less than or equal to 256 characters. And you will either have to make each constant fit on one line (e.g. use multiple constants each less than about 60 characters) or observe the rules for continuation of constants across multiple lines (specify characters up to column 71, then put an * in column 72, then continue in column 2 of the next line).
See the following for DFSORT's continuation rules:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.3.1?DT=20060615185603 |
|
Back to top |
|
|
|