Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Convert FB file to VB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Fri Nov 16, 2007 2:12 am    Post subject: Convert FB file to VB
Reply with quote

Hi,

I have a input file which is VB and has different record types and diferent lengths. The first four charactres of each record specifies the length.

The input file could be of as
0010aaaaaaaaaa
0020dddddddddddddddddddd

In the existing application this input file was taken and final file is now an FB file which has resulted in filling up the unused positions as spaces X'40'. The application has some 80 programs and hence I do not want to touch them.
However the application at the end creates a FB file with same length as input and this needs to be converted to VB.
Is there a utility by which I would be able to remove the spaces from unwanted position and convert the file back to VB given that I have lengths in the first 4 positions.
Or if I write a COBOL code to substring the record based on the lenght and write to the output VB file, be a right solution.

Thanks.

Sudhir
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 16, 2007 3:40 am    Post subject:
Reply with quote

It's not clear what you want.

The first FB input record has a length of 10 and 10 non-blank characters after the length.

The second record has a length of 20 and 20 non-blank characters after the length.

Do you want the VB output records to contain the RDW and just the non-blank characters, or the RDW, the length and the non-blank characters?
That is, do you want the VB output records to look like this:

Code:

|RDW|aaaaaaaaaa
|RDW|dddddddddddddddddddd


or like this:

Code:

|RDW|0010aaaaaaaaaa
|RDW|0020dddddddddddddddddddd


Also, does the length in the FB record always just include the non-blank characters, or can the length include trailing blanks. For example, could an FB input record look like this:

00101234567

with three trailing blanks included in the length?
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Fri Nov 16, 2007 4:13 am    Post subject:
Reply with quote

Hi Frank,

The FB file record contains the record length. The record length does not include the spaces after the record.

For example , the FB file is LRECL of 1000 but the record can have record length of 100, 300 and so on.

The problem which i am facing is that when I convert this FB file to VB and compare the original VB to the newly created VB file I get differences of trailing spaces after the record length.
I want to avoid the trailing space when the VB file is created out of FB, so that the two files compare as same.

Please let me know if I have not made my self clear.

Thanks.

Sudhir
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 16, 2007 5:06 am    Post subject:
Reply with quote

I understood what you were trying to do the first time you explained it.

What I didn't know and still don't know is whether you want to have the length value (e.g. 0010) from positions 1-4 of the FB input records in positions 5-8 of the VB output records. I thought I asked that question quite clearly, but you didn't answer it. So I'll show you how to get the VB file with and without that length value from the FB records.

If you want the length value in the VB records, you can use this DFSORT job:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/1000)
//SORTOUT DD DSN=...  output file (VB/1004)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FTOV,VLTRIM=X'40'
/*


FTOV will convert from FB records to VB records.

VLTRIM=X'40' will remove the trailing blanks and adjust the RDW length accordingly.

For your example input records, the VB output records would be as follows. Len is the length in the first 2-bytes of the 4-byte RDW. Data starts in position 5 and contains the length value from the FB records followed by the non-blank characters from the FB records.

Code:

Len Data
18  0010aaaaaaaaaa
28  0020dddddddddddddddddddd


If you don't want the length value in the VB records, you can use this DFSORT job:

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/1000)
//SORTOUT DD DSN=...  output file (VB/1000)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL BUILD=(5,996),FTOV,VLTRIM=X'40'
/*


BUILD=(5,996) will remove the length value.

FTOV will convert from FB records to VB records.

VLTRIM=X'40' will remove the trailing blanks and adjust the RDW length accordingly.

For your example input records, the VB output records would be as follows. Len is the length in the first 2-bytes of the 4-byte RDW. Data starts in position 5 and contains the non-blank characters from the FB records but does not contain the length value from the FB records.

Code:

Len Data
14  aaaaaaaaaa
24  dddddddddddddddddddd


Hopefully one of those is what you want.
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Fri Nov 16, 2007 5:29 am    Post subject:
Reply with quote

Frank,

Thanks for your help.

The keyword VLTRIM is the magic wand. I should be reading the documentation more closely.

Actually I will be needing both the solutions, to write the length and to skip writing the length.

Thanks.

Sudhir
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us