View previous topic :: View next topic
|
Author |
Message |
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
did you try running the job ?
Gerry |
|
Back to top |
|
|
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
Yes Anuj. |
|
Back to top |
|
|
notonly4u
New User
Joined: 26 Apr 2005 Posts: 87 Location: Hyderabad
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
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 |
|
|
notonly4u
New User
Joined: 26 Apr 2005 Posts: 87 Location: Hyderabad
|
|
|
|
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 |
|
|
Hardik Vachhani
New User
Joined: 11 Dec 2008 Posts: 13 Location: Phoenix, AZ, USA
|
|
|
|
Is there any option i can pad the trailing spaces with blanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
I think he means to say "replace the trailing spaces with NULL values" |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
Back to top |
|
|
|