View previous topic :: View next topic
|
Author |
Message |
bvanilkumar
New User
Joined: 23 Dec 2006 Posts: 10 Location: SYDNEY
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what environment...
batch ?
interactive, ISPF EDIT
in this case look at bounds and textflow commands
curious about the business requirement |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You are not converting from VB to FB, you are completely reformatting the data contents.
Dare I ask why ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
when the TS will reply to my questions we will be able to suggest better |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
bvanilkumar
New User
Joined: 23 Dec 2006 Posts: 10 Location: SYDNEY
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I wonder why people are not able to express a clear and complete requirement starting from the first post
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
> 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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|