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 record structure with VARCHAR to VB file.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Oct 08, 2012 9:05 pm    Post subject: convert FB record structure with VARCHAR to VB file.
Reply with quote

Hi,

We have a FB file with a length 21167 and would like to convert it to a VB file to save DASD space. Below given is the record structure:

Code:

FIELD-1        CHAR(3)  PRIMARY KEY
FIELD-2        CHAR(10) PRIMARY KEY
FIELD_DESC     CHAR(35)           
FIELD_NBR      CHAR(8)             
FIELD_TYPE     CHAR(25)           
FIELD_TS       TIMESTAMP           
FIELD_CHKSUM   CHAR(32)           
FIELD_STATE    VARCHAR(21000)     
FIELD_ID       CHAR(10)           
FIELD_DATE     DATE               
FIELD_FLAG     CHAR(1)             


The field "FIELD_STATE" hardly has data of maximum of 1900 characters only and minimum of 600 characters and does not exceed that. Can you please help me to convert this file from FB to VB. Is it possible? I don't know how to convert this because this field is lying in between other columns.

Please help.

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

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Mon Oct 08, 2012 9:36 pm    Post subject:
Reply with quote

Hi Ramsri,

How is this FB data set created? Unload of DB2 table?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Oct 08, 2012 9:42 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Hi,

Output FB dataset is created through program.

Thanks.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Mon Oct 08, 2012 9:51 pm    Post subject:
Reply with quote

So presumably this program moves the VARCHAR column to a fixed-length character field and writes a fixed-length record. Have you considered changing the program to use variable-length fields and records?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Mon Oct 08, 2012 10:04 pm    Post subject:
Reply with quote

Is it possible to change the program to create VB data set instead of FB one?

In General,

Code:
FD vb-file
RECORDING MODE V
RECORD IS VARYING IN SIZE FROM 1 TO max_value CHARACTERS
DEPENDING ON ws-var-length
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 vb-record  PIC X(max_value).


For every WRITE, move the desired data to vb-record as well as the desired length to ws-var-length and all will be OK.

In your case, while WRITE/READing ( if this VB data set is used as input), you'll need to have many record layouts for VB data set based on the record value and length. Perhaps, an indicator to identify the record type (record length) may be added at the starting of each record.

Please review.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Mon Oct 08, 2012 10:43 pm    Post subject:
Reply with quote

Whilst you are going about all this rearrange your structure so that the varchar field is the last field. You will have to recompile any program that uses that copybook (which you would have to do anyway as you are changing from FB to VB)

I assume you are wanting a SYNCSORT solution for this requirement otherwise you would have posted in one of the language sections or the DFSort section.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 09, 2012 8:17 am    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Hi, Program can't be touched (external system). We get the file and want to save DASD space on our side. Yes.....we use Syncsort and looking to convert it from FB to VB.

Thanks.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Oct 09, 2012 2:20 pm    Post subject:
Reply with quote

Hi,

like Nic says, you will need to change all programs that currently read the FB file after converting the file to VB, a lot of work just to save some space.


Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Oct 09, 2012 5:08 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Saving 19k per record is probably noticeable. It'd allow you to get more than two records per track :-)

Ramsri,

Note Nic's point about the fields after your VARCHAR. They need to be relocated.

What is your VARCHAR "padded" with? Does it actually contain the length in the first two bytes?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 09, 2012 5:50 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Bill, this is not a program from our system......we don't own it. we just get the file and create a backup. We find that its occupying too much of space even though it does not utilize all VARCHAR(21000) but hardly 1900 or 2000 of it.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Oct 09, 2012 6:07 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Err... I know all that.

If you want to make the record variable you have the easy way, which is to relocate you variable-length part to the "end" of the record. Or the difficult way, which is to plonk the variable-length part somewhere in the "middle" of the record and jump through hoops to find all the fields later.

You explained you can't change the program, and I've not suggested you need to. It is simple. At the same time as you make the record variable, you move the necessary fields.

FTOV, VLTRIM with whatever it is that you are keeping to yourself that is padding the VARCHAR.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Oct 09, 2012 6:15 pm    Post subject:
Reply with quote

You can use Syncsort to rearrange the fields and backup the data.

You can change to VB at that time.

Use Sycnsort to restore the data back to original format when/if needed.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 09, 2012 6:18 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

The VARCHAR (21000) content from file shows its length in binary format in output file........does it help anyway to create a VB from FB file. We can't rearrange the fields to move varchar to end of file.

Thanks.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Oct 09, 2012 6:23 pm    Post subject:
Reply with quote

Quote:
We can't rearrange the fields to move varchar to end of file


If this is a true statement then your are SOL (system out of luck).

So sorry.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Oct 09, 2012 6:29 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Code:
FIELD-1        CHAR(3)  PRIMARY KEY
FIELD-2        CHAR(10) PRIMARY KEY
FIELD_DESC     CHAR(35)           
FIELD_NBR      CHAR(8)             
FIELD_TYPE     CHAR(25)           
FIELD_TS       TIMESTAMP           
FIELD_CHKSUM   CHAR(32)           
FIELD_ID       CHAR(10)           
FIELD_DATE     DATE               
FIELD_FLAG     CHAR(1)
FIELD_STATE    VARCHAR(21000)     


Ramsri,

I managed it.

If you can't do that tell us why not?

Then, with your secret trailing character and VLTRIM you can get variable-length records. If you want to go for fixed-length-but-shorter you can do that, but note that the fields following the VARCHAR will change their position.

Sit back and read through the whole topic.

Then tell us what you are not allowed to do, and why, and then rather than knocking-back suggestions which have not been made, one by one, we can get a grip on the whole thing?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 09, 2012 6:30 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

if You simply want to create a backup
use DFDSS, it has quite a good compression factor!
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 09, 2012 6:50 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Bill, no....I am not knocking back the suggestions icon_eek.gif I thought the rearrangement might confuse the appl. programmer when one wants to bring the data from backup and use it as input somewhere. I think some kind of notes in backup JCL should be written. icon_surprised.gif

Is this solution work on big/large files? The file always contains records anywhere between 300,000 to 450,000.

Please suggest the solution you offered.

Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 09, 2012 6:52 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Quote:
Please suggest the solution you offered.


who are You asking ???
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Oct 09, 2012 7:03 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Sorry Ramsri, I missed the "I just want to create a backup" whilst I was being "all-knowing" :-)

Leave the file alone. Look at what enrico posted. If you change the file, it mightn't count as much of a backup, and would only save a couple of extra bytes over enrico's suggestion.

Edit: And even those couple of bytes might be "lost" to other compression possibilities in the record. Why didn't you say up front you just wanted a backup?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 09, 2012 7:24 pm    Post subject: Reply to: convert FB record structure with VARCHAR to VB fil
Reply with quote

Enrico, I see few of our jobs use PGM=ADRDSSU but write to UNIT=TAPE. Can I write to a tape instead of DASD? Does writing to tape saves space too?

Thanks.
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
Goto page 1, 2  Next
Page 1 of 2

 

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 Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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