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

Writing chunk of records into next line - Delimit function


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

New User


Joined: 04 Apr 2008
Posts: 9
Location: Noida, India

PostPosted: Thu Nov 11, 2010 10:25 pm
Reply with quote

Hi,

I have a input as

Input Data:
228609200000919N246971500002349N569193100001226N763652000000919N

Now my requirement is that, when the character 'N' appears in the above input, then the next chunk of data should be printed into next line.

Desired Ouput:
228609200000919N
246971500002349N
569193100001226N
763652000000919N

Although I am able to do it by reading the file into an array and then writing it to the next line when the character 'N' appears.But this is increasing the execution time of the program.

I wonder if it can be done by SORT.

Please guide me, so that I can do this by Using SORT.
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: Fri Nov 12, 2010 2:25 am
Reply with quote

What is the RECFM and LRECL of the input file?

What is the maximum number of output records you expect?

Are the chunks of data always 16 bytes in your example? Or can they be different sizes? If so, please show a better example where the chunks are not always 16 bytes.
Back to top
View user's profile Send private message
pranav yadav

New User


Joined: 04 Apr 2008
Posts: 9
Location: Noida, India

PostPosted: Fri Nov 12, 2010 4:25 am
Reply with quote

Frank thanks for replying

The RECFM is FB, LRECL is 256 bytes.

Maximum no of output records is around 75000000, each of 16 bytes.

Yes the chunks of data are always of 16 bytes in my file.
Character 'N' appears always appears at the fixed positon, i.e, always after the first 15 characters.

I am getting excited to know the Sort card for this. I hope I will get one.
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: Fri Nov 12, 2010 5:46 am
Reply with quote

So are you saying the N at the end really has no significance and you really just want to divide each 256 byte record into sixteen 16-byte records? If the N has significance, then you haven't actually explained what significance it has.

If you do want to divide each 256 byte record into 16-byte records, the easiest way to do that is with the new RESIZE operator of DFSORT's ICETOOL available with z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), like this:

Code:

//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG  DD SYSOUT=*                                             
//IN DD DSN=...  input file (FB/256)                       
//OUT DD DSN=...  output file (FB/16)                           
//TOOLIN   DD   *                                                 
RESIZE FROM(IN) TO(OUT) TOLEN(16)   
/*                                                               


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

If you don't have that PTF, then you can do it with a more complex DFSORT job like this:

Code:

//S2 EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD DSN=...  input file (FB/256)                       
//SORTOUT DD DSN=...  output file (FB/16)                         
//SYSIN DD *                                                       
  OPTION COPY                                                     
  OUTFIL BUILD=(1,16,/,17,16,/,33,16,/,49,16,/,
       ...)


The / means start a new record. Just specify each 16-byte chunk.
Back to top
View user's profile Send private message
pranav yadav

New User


Joined: 04 Apr 2008
Posts: 9
Location: Noida, India

PostPosted: Sat Nov 13, 2010 6:37 pm
Reply with quote

Thanks alot Frank for your help.

I was able to do the required processing with my file.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top