Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OUTREC coding with Varible block records

Status
Not open for further replies.

Idiot

Programmer
Oct 8, 2000
26
US
Hi Gems !

I have a Variable block file.It is a tape file with LRECL=23472(with 4 bytes RDW) and Blocksize=23476.

I have to edit this file to replace column positions 333-336 with numberic value 9999 and then copy it into an output file.

I am trying the following OUTREC statement with SYNCSORT(SORT) utility.

SORT FIELDS=COPY
OUTREC FIELDS=(1,332,333:c'9999',337)

I am not sure whether this is the correct way to code OUTREC statment but it is not working.

The output file is coded with following attributes
DCB=(RECFM=VB,LRECL=23472,BLKSIZE=23476)
which are same as the input file


I am getting the following error

WER108I SORTIN : RECFM=VB ; LRECL= 23472; BLKSIZE= 23476
WER237I OUTREC RECORD LENGTH = 23468
WER110I SORTOUT : RECFM=VB ; LRECL= 23472; BLKSIZE= 23476
WER244A OUTREC - SHORT RECORD


Please suggest me how to code OUTREC to accomplish my objective.

Thanks,
Idiot
 
Idiot (what's in a name?),

the message indicates that an input record was shorter then the fixed portion you state, that is: shorter then 332, including RDW. Check your input file whether this is the case. If not, call back; as far as i can tell, it should work.

Good luck,
Ronald.
 
Hi I,

Try:

OUTREC FIELDS=(5,336,337:c'9999',341)

The sort will deblock the recs but includes the rdw as part of the data when it moves them to the out rec; therefore all osets must include the len of the RDW.

If your OUTREC includes the RDW len then you might want to try:

OUTREC FIELDS=(5,332,333:c'9999',337)

Regards, Jack.
 
Jack,

you've got me puzzled here; if you start including data from pos 5 onwards, you exclude the original RDW. Sounds like a plan, 'cause the new records are going to be longer, so a new RDW has to be determined (i hope Syncsort does this ...).
With this in mind, i can't figure out "... but includes the rdw ..." in relation to the statement "... =(5,336, ..." (shortened out of lazyness); i read this as:
starting at 5 (so after the RDW), including the next 336 pos's (so with the RDW !).

Idiot,

do you mean by "... column positions 333-336 ..." in your original post actual data columns, or did you account for the RDW as well ?
In the first case, Jack's second proposed statement,

"OUTREC FIELDS=(5,332,333:c'9999',337)",

should work.
Then again, i usually need about a dozen attempts before getting stuff like this to work. Analyzing error messages carefully and experimenting should leave you with something working in the end.

Regards,
Ronald.
 
Hi Ron,

Yeah, I see what you mean; that was sloppy. What I meant was that the sort will either recalc the lrel or "copy" it from the I/P. BTW, I'm not sure if that's done, (I don't have a manual handy) but it's worth a shot.

Regards, Jack.
 
Jack,

... and that is exactly how i usually solve problems with Syncsort: shooting at it until i hit something ...

Idiot,

my comment on the short record and Jack's solution should get you going. Keep us informed if you will; there can never be too much to be learned about Syncsort ...

Regards,
Ronald.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top