I need some help... I'm trying to copy (nothing fancy like sorting) a variable length file (lrecl 6004) to a fixed length file (of varying sizes, less than lrecl 6004). I'm using this for one of my files:
which works fine. However, I want to be able to use a generic term for the rest of the record, i.e. instead of the record length of the fixed file (i.e. 433), as the record length isn't always the same. Is there a way of doing this? At the moment I'm using Fileaid (PADCHAR) command, but this is very inefficient and I need something that will run a bit faster.
What are the numbers? 44 appears to relate to the record length of the input file, which I could (presumably) specify as 6004 as I know that value every time. 80 appears to relate to the record length of the output file, however I don't know what this value will be. Am I mistaken?
I want to be able to move a variable length records (length of variable file is 6004) to a fixed length file. The length of the fixed file varies each time so I don't want to hardcode the length. There won't be any padding involved as the record length for all the records on the variable file will equal that of the fixed length file.
length of the fixed file varies each time so I don't want to hardcode the length.
Say you want a length of 50 one time and a length of 100 the next time. How is DFSORT supposed to know that if you don't specify the length as 50 or 100? You need to specify the length somewhere. DFSORT can't guess the length you want, or read your mind. So what are you NOT saying about how DFSORT is supposed to know the length, or what am I missing here?
Are you trying to say that the length of each input record as indicated in the RDW is the same for all of the records and that's the length (-4 for the RDW) you want for the output file? For example, for one case the length of all the input records is 50 so you want the output length to be 46 and contain input positions 5-50 and for another case the length of all the input records is 85 so you want the output length to be 81 and contain input positions 5-85?
It's kind of unusual for a VB file to have records that are all the same length (that kind of defeats the purpose of having a VB file).
I guess that's the question. Can DFSORT do it? Looks like it can't. In, for example, a REPRO, the length doesn't have to be specified, it just takes the record and drops it in to the output file. If DFSORT doesn't have that facility, then I won't be able to use it.
Do what????? You still haven't explained clearly what you want to do! (I think you think you have, but that's because you understand what you want to do - I don't, so you have to explain it to me clearly.)
Is the output data set NEW or OLD? Does it already have the RECFM and LRECL in the DSCB, or do you specify the RECFM and LRECL on the output DD statement, or what?
What is it exactly that REPRO does? Show me the REPRO job that does whatever it is you want to do.
It is my guess about what OP whats to achieve -
Suppose there is an input file of RECLN=500 and VB,
he wants o/p in FB with length 500 without specifying parameters in JCL or SORTCARD/ pass variable value in SORTCARD..
Joined: 14 Mar 2007 Posts: 8646 Location: Back in jolly old England
My understanding of the OP problem is that he has a VB file or LRECL 6004 which is wanted in an FB format file with LRECL 6004.
Not knowing the length of each record within the VB file seems to be the problem, where as in the example I posted above, I know the length of the field that I am extracting, so coded it as 29,44, with the 80:X on the end.
I guess he's looking for something like
OUTREC=(5,to end of rec,6004:X)
Not sure of the syntax for this, but if I get a chance I will try and look it up.