View previous topic :: View next topic
|
Author |
Message |
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
Hi,
I am facing a small problem but need to resolve quickly. We have a file written sequentially i.e. records are written on same line continously. I want to create a dataset which will have single record on each line. record length is 24 byte.
existing ds:
r1r2r3r4....
new
r1
r2
r3
r4
Thanks,
Jagjit |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
For someone who wants things "quickly", you have not posted enough info for someone to help. . .
What is the dsorg/lrecl of the input? How many "r" values might be in a line (max)?
What should be the dsorg/lrecl for the output be?
Are there any "rules" you have not yet mentioned? |
|
Back to top |
|
|
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
Thanks for responding soon Mr. Scherrer
Input file:
DSORG is PS
Lrecl its showing 0. Problem with file is all records are appended till the maximum length of row ie 23040.
Output file
DSORG should be PS
LRECL is 24
Thanks,
Jagjit |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
So the embedded records are length 24 (not 2 as posted)?
Is there only 1 23040-byte record?
What happens if the number of embedded records grows?
How is this file being created? If it is received via ftp, the upload might be changed to store the proper file. . . |
|
Back to top |
|
|
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
File is receive after Connect direct. All records are populated in file sequentially. There are some 2.2 million records. This file has around 2300 rows. This is correct criteria for receiving file and file is correct. We just want to split each record in such a way that we create new file with each row having 24 bytes when it starts reading the input file.
r1r2 is just for example I kept r1 has a length of 24 byte.
sorry for confusion. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I imagine that the soultion will have to be a BUILD statement with the fields defined for each 24-character segment, and an imbedded new line in between:
Code: |
OPTION COPY
OUTFIL BUILD=(1,24,/,25,24,/,49,24,/,
......
23017,24) |
|
|
Back to top |
|
|
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
Thanks mate ...I will check tomorrow for this sequence.
I hope it will work. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It should as long as there are no surprises in the data. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can use the new RESIZE operator of DFSORT's ICETOOL to do this quite easily like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/23040)
//OUT DD DSN=... output file (FB/24)
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(24)
/*
|
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 |
|
Back to top |
|
|
|