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
 

 

Horizontal merge with no keys in files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 114
Location: Hyderabad

PostPosted: Thu Mar 12, 2009 6:03 pm    Post subject: Horizontal merge with no keys in files
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    Post subject:
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: 114
Location: Hyderabad

PostPosted: Thu Mar 12, 2009 6:30 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 12, 2009 10:28 pm    Post subject:
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: 114
Location: Hyderabad

PostPosted: Fri Mar 13, 2009 9:56 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Mar 14, 2009 2:06 am    Post subject:
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: 114
Location: Hyderabad

PostPosted: Tue Mar 17, 2009 3:46 pm    Post subject:
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    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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm


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