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

Convert VB dataset to FB dataset


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bvanilkumar

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Thu May 29, 2008 1:08 pm
Reply with quote

Say, i have a VB dataset with data in three lines as shown below.

abcdefghijklm
nopqrstuv
wxyz


Need to create a new dataset with LRECL 10 and RECFM FB using the above dataset. Output should be as mentioned below.

abcdefghij
klmnopqrst
uvwxyz


Can anybody advice how to do this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 2:21 pm
Reply with quote

what environment...
batch ?
interactive, ISPF EDIT
in this case look at bounds and textflow commands

curious about the business requirement icon_question.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 29, 2008 3:47 pm
Reply with quote

You are not converting from VB to FB, you are completely reformatting the data contents.

Dare I ask why ?
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 May 29, 2008 4:11 pm
Reply with quote

Hi,

I just re-read the output shown, yes agreed, this is not VB to FB conversion, links provided earlier (removed) might not work for the original question. This is reformatting of records as said earlier & not just a "VTOF" conversion, to fetch some good suggeston you uneed to tell the rules to create the output.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 6:39 pm
Reply with quote

when the TS will reply to my questions we will be able to suggest better
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 7:30 pm
Reply with quote

since I am in a good mood here is a rexx snippet to reflow some data lines

input is taken from inp. output will be stored to out. reflow size is taken fro fsize

Code:
i     = 0
inp.  = ""
inp.0 = 3
inp.1 = "1234567890xx1qwertyud02cswerty03tytytyty04tytytytytytytytyty"
inp.2 = "jiosjchrevsqwaxdrpn"
inp.3 = "podkopdodod"

j     = 0
out.  = ""
out.0 = 0

fsize = 10
stack = ""

do    99
   
   say  right(length(stack),3) stack
   if   length(stack) < fsize then do
      if i < inp.0 then do
         i = i + 1
         stack = stack || strip(inp.i)
         iterate
      end
      else ,
         leave
   end

   j = out.0 + 1
   out.j = left(stack,fsize)
   out.0 = j
   stack = substr(stack,fsize+1)

end

if length(stack) > 0 then do
   j = j + 1
   out.j = stack
   out.0 = j
end

do j = 1 to out.0
   say right(j,2) right(length(out.j),2) out.j
end

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

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Thu May 29, 2008 8:24 pm
Reply with quote

Hi,
Let me make my requirement clear.

I have a PS (with RECFM 'U') with 2 lines. First line has data upto record length 27841. Second line has data upto record length 17614

I need to have the full data of the above PS into a new dataset with RECFM 'FB' and LRECL '80'.
i.e. The first line must be retrieved to second dataset with 27841/80 number of lines and second line with 17614/80 lines.

Hope the requirement is clear now.
Please advice.

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 29, 2008 8:32 pm
Reply with quote

I wonder why people are not able to express a clear and complete requirement starting from the first post icon_evil.gif

You started with a ...say... which in common speech means ...
for example, I am just curious, ....

and started requesting something for a vb dataset with short records and very few lines

now You talk about undefined record format with huge records,
and You ask to reflow to fixed lrecl 80...

the record sizes You showed are not divsible by 80
what about the remainder

the two records should be seen as a continuous streams of bytes ??

it meaans that if the last record of the first block is shorter than 80 bytes
should it be filled with bytes from the second record or not??

please make up Your mind and at the third try state clearly Your requirements

but one more question
how did You get a dataset with recfm U to start with ??
usually it is a error when it happens
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu May 29, 2008 10:24 pm
Reply with quote

> how did You get a dataset with recfm U to start with ??
> usually it is a error when it happens

In the good old days, I would have just zapped the DSCB to make it FB80.
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: Fri May 30, 2008 1:01 am
Reply with quote

Hello,

It may help if Anil explains what process is going on (or is needed).

The "file" sounds more like a load library than a data file. As was asked before, what created the recfm=u file/data?

Is this some one-time process or will different amounts of data be "input" to future executions? What is the max size of a single group of data that needs to be "re-flowed"? Where did the 2 posted "max-lengths" come from? How might these lengths be known from the data?
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top