Basically, I need to take the record from a VB file, insert spaces at a certain location and then write that record to a VB file. All this using SYNCSORT.
Input File Length: 504 (500 data + 4 RDW)
From this input file, I need to insert 10 spaces starting from 5th data position (i.e. 10th actual column) to 14th data position (i.e. 19th actual column). Luckily, the last 25 columns in the record is FILLER, so need not bother to increase the file length of the new output file. This FILLER region can be used. This modified record must be written to a file of the same record length of 504.
Hi Ekta. I did go through the post, I am still confused. I tried using VLTEST=0, hoping that the records lengths will not be considered but still it gives me the same error which says that OUTREC - SHORT RECORD. I am not familiar with using the PARM options.
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
balimanja, You specified 10,485 in the OUTREC statement. This says that each record must be at least 500 bytes long. While the message WER244A, tells you that one or more of your variable-length records is not that long.
And what about 9th posistion, per your card?
I'm not connected just now -- but it seems you can work around by keeping these things in mind.
Just for try,You may use,
This says that each record must be at least 16 (am I correct?) bytes long, which I suspect they are.
Thanks Ekta & expat. It seems to be working. But there was one thing that I forgot to mention. This file has a header and trailer.
The header lasts until 14th data column (19th actual column)
As I was trying your suggestions, I noticed that the code was working for only those columns that were within the header.
The above code would work only until 15 (actual column) i.e.
Beyond this, it would throw an error as I had mentioned above. I have a fair idea to byepass this and satisfy my above requirement of including spaces. But I can't think of doing it without using 3 steps associated with one invocation of SYNCTOOL & TOOLIN statements. Please let me know if there is any way in which I could do it more efficiently.
I will post the method along with the result soon.
Yes Anuj, I realised that the error was because of the header which was the shorter one... I am trying to find a way to byepass this problem i.e. exclude header and trailer while applying the logic that inserts spaces as per the requirement.
Now I have split up the input records, inserted space in them (well it is a little different that what I had initially asked for .)
Here is the TOOLIN for the above CNTL.
COPY FROM(IN1) USING(LGC1)
Now that all the data are in separate files, I am stuck as to how to merge the Header, 'the Other Type Record', Data records and the Trailer (in the mentioned order). The Final file needs to be sorted as (2,13,CH,A).
Please let me know as to how to merge them together.