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
 

 

Writing chunk of records into next line - Delimit function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Writing chunk of records into next line - Delimit function
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 Moderator


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

PostPosted: Fri Nov 12, 2010 2:25 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Nov 12, 2010 5:46 am    Post subject:
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:

http://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    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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