View previous topic :: View next topic
|
Author |
Message |
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
I have an input file FILE1 of FB format and record length 80 . But the data in this file keeps varying. I want to use another file FILE2 whose length should be of the data present in FILE1 . Each day the length of data in FILE1 would change. So according to that FILE2 should have the length. Is there any way to achieve this using a DFSORT or JCL . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Well, there is no way to do this "with JCL". Some utility would have to be invoked (sort or something else).
In order for anyone to help, you need to provide more complete info about what you want this to do. One way might be to show some sample input and what you want as output when that sample iknput is processed.
If the record length is 80, how does the data keep varying. . . Every record in that file is 80 bytes long. Why/how would the length change each day? |
|
Back to top |
|
|
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
What i meant was , though the file declaration is FB , LRECL = 80 , the length of the content in the file might be 80 or less than 80 .
Say if i say the LRECL=10 , the data in the file could be as follows:
Hi John
Hello Sam
Hi Tina
Now i want to use another file in JCL , which should take the maximum data length (9 - based on the above input) from the input file . HOw do we achive this using SORT ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
The way you have explained your question - an obvious answer seems to be, no it can not be done.
When you say this:
Quote: |
though the file declaration is FB , LRECL = 80 , the length of the content in the file might be 80 or less than 80 .
Say if i say the LRECL=10 , the data in the file could be as follows: |
The bold text in above quote is "record-length" -- that's not LRECL. As far as i understand your question, you've got two choices:
1. Your program should be intelligent enough to deal with different record-lengths, if you are supposed to get data with different lengths. And your FD declaration should deal with VB file not FB.
2. Edit your program such a way that it treat every record as if it is of length=80 and use RECFM=FB in JCL.
If you expect something beyond the above two, you need to do a better job in explaing your problem. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sounds to me as if the TS wants to 'parse' the input file of 80 char,
which will be consistant,
and output only 'non space characters',
effectively creating an output file whose length is based on non-space char input.
Ambili S,
why do you want to do this?
creating dynamic record lengths
makes it difficult for the the down-stream processes.
explain why you want to do this. |
|
Back to top |
|
|
|