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

Copying VB file to FB


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed Sep 09, 2009 11:15 pm
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: 1249
Location: Richfield, MN, USA

PostPosted: Thu Sep 10, 2009 8:05 am
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: 1702
Location: Australia

PostPosted: Thu Sep 10, 2009 10:25 am
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
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: 1702
Location: Australia

PostPosted: Thu Sep 10, 2009 11:26 am
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
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

Superior Member


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

PostPosted: Thu Sep 10, 2009 2:57 pm
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
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
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

Superior Member


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

PostPosted: Thu Sep 10, 2009 3:10 pm
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
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 10, 2009 3:34 pm
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

Superior Member


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

PostPosted: Thu Sep 10, 2009 3:39 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Sep 10, 2009 4:36 pm
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

Moderator Emeritus


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

PostPosted: Thu Sep 10, 2009 8:25 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top