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

Horizontal merge with no keys in files


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

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Mar 12, 2009 6:03 pm
Reply with quote

Hi,
I have a file

File :

Code:

Address1 is h.no225....................251 chars
pincode 10235......73 chars
Address2 is h.no226....................251 chars
pincode 222222......73 chars
Address3 is h.no227....................251 chars
pincode 333333......73 chars


The output file should contain one record for first two record of from the input file with record length 324 like :

Code:

Address1 is h.no225....................pincode 10235......total 324chars
Address2 is h.no226....................pincode 22222......total 324chars
Address2 is h.no227....................pincode 33333......total 324chars


Actually, this is a report that we got from external system. No keys will be present in it.

In order to do that I have split the file into two files with all odd number records into one file and even number records into another file. I have inserted sequence numbers in a step to use it as key for splicing.

Still i am not able to get the desired output. Is there any simpler way to achieve this?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Mar 12, 2009 6:19 pm
Reply with quote

1: Please post LRECL and RECFM of both files?
2: do you need to club every two records to one always?
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Mar 12, 2009 6:30 pm
Reply with quote

1.Input file record length is 251. Expected Output file record length is 324
It is fixed block
2. Yes i need to club every two records. It has some 70000 records. Output should have only 35000 records.

All the odd number records in the input file have a data till 251 positions. But the even number records have data till 73 position and rest all spaces.
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 Mar 12, 2009 10:28 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file (FB/251)
//SORTOUT  DD DSN=...  output file (FB/324)
//SYSIN    DD *
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(74:1,251,325:SEQ=1))
  SORT FIELDS=COPY
  OUTFIL INCLUDE=(325,1,ZD,EQ,2),BUILD=(74,251,1,73)
/*
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Mar 13, 2009 9:56 am
Reply with quote

Hi Frank,

It is throwing me the following error when using WHEN=GROUP

Code:

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                     
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 09:49
            INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(6:1,7,13:SEQ=1))
                               £                                     
ICE007A 0 SYNTAX ERROR                                               
            SORT FIELDS=COPY                                         
            OUTFIL INCLUDE=(13,1,ZD,EQ,2),BUILD=(6,7,1,5)           
ICE052I 3 END OF DFSORT                                             
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 13, 2009 10:43 pm
Reply with quote

kranthikumarb,

You don't have the latest PTF available at your shop. Here is an alternative way to do it

Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD DSN=your 251 byte input file,
//            DISP=SHR
//OUT      DD DSN=Your output 324 byte file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *                                                 
  SPLICE FROM(IN) TO(OUT) ON(326,8,CH) WITH(252,74) USING(CTL1)
/*
//CTL1CNTL DD *                                                 
  SORT FIELDS=COPY                                             

  INREC IFTHEN=(WHEN=INIT,                                     
  OVERLAY=(325:SEQNUM,1,ZD,START=0,INCR=5,SEQNUM,8,ZD)),       
  IFTHEN=(WHEN=(325,1,ZD,EQ,5),                                 
  BUILD=(252:1,74,326:326,8,ZD,SUB,+1,M11,LENGTH=8))           

  OUTFIL FNAMES=OUT,BUILD=(1,324)                               
/*
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: Sat Mar 14, 2009 2:06 am
Reply with quote

Quote:
It is throwing me the following error when using WHEN=GROUP


You are using DFSORT R14. That release is no longer supported. The PTF for WHEN=GROUP, etc is only available for the two current DFSORT releases: z/OS DFSORT V1R5 and z/OS DFSORT V1R10.

You really should be on a later release of z/OS and DFSORT by now.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Tue Mar 17, 2009 3:46 pm
Reply with quote

Thanks Skolusu. It JCL you posted worked perfectly for me.

Regards,
Kranthi Kumar
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top