Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us