IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File for varying data length


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 14, 2010 9:28 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 14, 2010 9:38 am
Reply with quote

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
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 14, 2010 11:59 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 14, 2010 2:37 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Sep 14, 2010 4:01 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top