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 sequential file to particular record length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Convert sequential file to particular record length
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

Site Director


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

PostPosted: Tue Sep 21, 2010 12:13 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 21, 2010 12:59 am    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Sep 21, 2010 1:49 am    Post subject: Reply to: Convert sequential file to particular record lengt
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    Post subject:
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

Site Director


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

PostPosted: Tue Sep 21, 2010 5:17 am    Post subject:
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 Moderator


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

PostPosted: Thu Oct 28, 2010 3:26 am    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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