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
 

 

Copying VB file to FB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Wed Sep 09, 2009 8:38 pm    Post subject: Reply to: Finding the Record Length
Reply with quote

Hi,

I have a query that falls under this topic,

I have a VB file with LREC of 1015, need to dump this into a FB file having the LENGTH of Records as the first four digits of the new FB file.

Tried using JCL in this post, but was facing data length incompatibility issues.

I am having SYNCSORT installed at my shop.

Please advice.
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Wed Sep 09, 2009 11:15 pm    Post subject:
Reply with quote

Hello,

When you have a question, it is best to start a new topic for your question.

Quote:
I have a VB file with LREC of 1015, need to dump this into a FB file having the LENGTH of Records as the first four digits of the new FB file.
Why waste the space to create an FB file?

If the records become fixed length, they will all be the same length. . .
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Thu Sep 10, 2009 8:05 am    Post subject:
Reply with quote

And if you need to know the length of each of the variable-length records, COBOL can retrieve it for you using the RECORD IS VARYING (Format 3) clause. See Language Reference Manual.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Sep 10, 2009 10:25 am    Post subject:
Reply with quote

Hi,

you can give this a go
Code:
//STEP0001 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=input-dsn,  LRECL=1015                               
//            DISP=SHR                                                 
//FB       DD DSN=output-dsn                                           
//            DISP=(,CATLG,DELETE),                                     
//            UNIT=SYSDA,DCB=RECFM=FB,                                 
//            SPACE=(CYL,(10,5),RLSE)                                   
//SYSIN    DD *                                                         
  OPTION COPY                                                           
  OUTFIL FNAMES=FB,VTOF,OUTREC=(1,2,BI,EDIT=(TTTT),5,1011)             
/*                                                                     



Gerry
Back to top
View user's profile Send private message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Thu Sep 10, 2009 11:23 am    Post subject: Reply to: Copying VB file to FB
Reply with quote

hi thanks for help, but i need to know the actual data length.??

for e.g. data is as under in VB file

AAAAA AAAA
BBB BBBBBB
CCCC CC

the output FB file is as under

0010AAAAA AAAA
0010BBB BBBBBB
0007CCCC CC
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Sep 10, 2009 11:26 am    Post subject:
Reply with quote

Hi,

did you try running the job ?


Gerry
Back to top
View user's profile Send private message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Thu Sep 10, 2009 11:28 am    Post subject: Reply to: Copying VB file to FB
Reply with quote

yes i ran the job with the outres specified in your post, got the total length instead of actual one i was looking for.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Sep 10, 2009 2:57 pm    Post subject: Re: Reply to: Copying VB file to FB
Reply with quote

Hardik Vachhani wrote:
... got the total length instead of actual one i was looking for.
And what does this mean? Did you get same length for all the records?
Back to top
View user's profile Send private message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Thu Sep 10, 2009 2:59 pm    Post subject: Reply to: Copying VB file to FB
Reply with quote

Yes Anuj.
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Thu Sep 10, 2009 3:07 pm    Post subject:
Reply with quote

Are you sure that you are not having spaces in the end?
Open your input in browse mode, do an "HEX ON".
There should not be spaces in the end.

Code:
CCCC CC   
CCCC4CC444
3333033000


The above case will give the length as 10.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Sep 10, 2009 3:10 pm    Post subject:
Reply with quote

Then your input file is a "false VB file". All the records are of same length while RECFM is kept as VB. Possibly, records are padded with spaces, show us HEX equivalent of couple of your input records.
Back to top
View user's profile Send private message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Thu Sep 10, 2009 3:11 pm    Post subject: Reply to: Copying VB file to FB
Reply with quote

Ok i got it, the data i have is having space in it, its like this:
Code:

CCCCC
CCCCC4444444444444444444444444444444444444444444
3333330000000000000000000000000000000000000000000


So is there a way to get actual data length in this case?
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Thu Sep 10, 2009 3:21 pm    Post subject:
Reply with quote

If you are creating this file using some programs, the only way is to change that to write proper data in output.
Back to top
View user's profile Send private message
Hardik Vachhani

New User


Joined: 11 Dec 2008
Posts: 13
Location: Phoenix, AZ, USA

PostPosted: Thu Sep 10, 2009 3:29 pm    Post subject: Reply to: Copying VB file to FB
Reply with quote

Is there any option i can pad the trailing spaces with blanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Thu Sep 10, 2009 3:34 pm    Post subject:
Reply with quote

Quote:
Is there any option i can pad the trailing spaces with blanks.
Since blanks are spaces, what are you trying to say with this statement???
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Sep 10, 2009 3:39 pm    Post subject:
Reply with quote

Quote:
Since blanks are spaces, what are you trying to say with this statement
That I don't understand the difference between them!
Back to top
View user's profile Send private message
rockish

Active User


Joined: 05 Jun 2009
Posts: 185
Location: Planet Earth

PostPosted: Thu Sep 10, 2009 4:35 pm    Post subject:
Reply with quote

I think he means to say "replace the trailing spaces with NULL values"
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Sep 10, 2009 4:36 pm    Post subject:
Reply with quote

rockish wrote:
I think he means to say "replace the trailing spaces with NULL values"

But you can't do that in a file with format FB. By default the remainder of the record must be something, else it becomes a VB format record.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Sep 10, 2009 8:25 pm    Post subject:
Reply with quote

Hello,

To repeat my first reply. . .
Quote:
Why waste the space to create an FB file?

If the records become fixed length, they will all be the same length. . .

What is the goal of this process? Why is the input not a properly created variable length file? How will this new kludge of a file be used? How might there be a fixed length yet variable file (ie. the trailing blanks/spaces removed?

Until some much more clear definition of what is needed is posted, it will be most difficult to provide any help icon_sad.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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