Oh sorry,, yes Garry, after posting the code into this formun ,I noticed that one and changed to //SYMNAMES and ran it but still getting the syntax error.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Hi misra,
I would if I could :-) I was just highlighting it for a moderator (who can) and for you for next time, and for you to know where it is gone if you can't find it in DFSORT later.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You have a "short" record on your input file, which means that the record finishes before the end of one of the parts you are using for your output record.
If you try to copy 20 bytes to some position in the output but the input record is only 10 bytes long, you'll get this message.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Misra,
Nice to see you using SYMNAMES, by the way.
Fld1 could be more meaningful.
It also, for a VB, should start at 5, not 1, which is in the start of the RDW, or you should not include the 1,4 for the RDW (which you didn't give a SYMNAME).
Isn't the output going to be the same length for each record now? The sort product is going to write it as variable because the input is variable, but is that what you really want?
The output record length will not be same as input reccord. After reformatting, the output field will have greater length than the input field.
for e,g Field-4 is Invoice-No and value is 'ERS-37164-2177914' which is 17 char length and after reformatting it will be fixed one with 35 char length.rest will be be spaces.
But input file will always have shorter record than 219(VB) which is file lengfth.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
devmisra,
Your header record itself is in fact a "short record" since your parse starts at ABSPOS=27.
If you don't have any more short records other than the header record, you can have a condition check like this.
Is your goal to have a fixed length file? Will the receiving program/utility be expecting it as fixed length?
It's the type of thing that will sneak up on you later, when you think you've got it figured out. Then you have to come back to this step and try to fix it.
Amount field positions are 113-130, 132-149 and 151-168. Length is 18.
Please suggest how to Left Pad the amount fields with zeros in the same BUILD part of the SORT card .
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Why was it decided that this exercise is even needed
The data shown in the first post is perfectly usable as is (unless this is to accommodate unqualified programmers). If this is the case, i suggest the programmers be brought up to speed rather than waste machine resources "forever".
If there is some real business requirement it would be nteresting to know what it is.
Keep in mind this could be done in a very simple COBOL program using UNSTRING. . . A very simple program.
read the record
if the header - whatever
if not the header unstring and write the new record
Actually, I am generating a VB file which will contain around 200k records. To review the file data with table data, i need to know the Sum of the amount fields. I thought SORT will be an easier way to achieve the Total amounts. The whole process is not for production, only to review Test/QA data.
When i went thru the SORT cards I learnt PARSE function, so it got more interesting when i tested and got the result.... :-)