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

Convert sequential file to particular record length


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Tue Sep 21, 2010 12:04 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 21, 2010 12:13 am
Reply with quote

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
View user's profile Send private message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Tue Sep 21, 2010 12:24 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 21, 2010 12:59 am
Reply with quote

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
View user's profile Send private message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Tue Sep 21, 2010 1:10 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Sep 21, 2010 1:49 am
Reply with quote

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
View user's profile Send private message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Tue Sep 21, 2010 3:55 am
Reply with quote

Thanks mate icon_smile.gif ...I will check tomorrow for this sequence.
I hope it will work.
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: Tue Sep 21, 2010 5:17 am
Reply with quote

Hello,

It should as long as there are no surprises in the data. . . icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 28, 2010 3:26 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top