Merging three files using ICEtool - need help

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Manali
Member
Posts: 4
Joined: Fri Oct 22, 2010 11:50 am

Merging three files using ICEtool - need help

Post by Manali » Fri Oct 22, 2010 12:22 pm

I have two problems

First one :

I need to merge three input files with key (a1,a2,a3,a4) in a JCL

file1 :

a1 b1 c1 d1
a2 b2 c2 d2
a3 b3 c3 d3
a4 b4 c4 d4


fil2 2 :

a1 b1 e1 d1
a2 b2 e2 d2
a3 b3 e3 d3
a4 b4 e4 d4

Output should be


a1 b1 c1 d1 e1
a2 b2 c2 d2 e2
a3 b3 c3 d3 e3
a4 b4 c4 d4 e4

Second Problem :

I have a date field in format CYYDDD . I need to convert it to the format YYYYMMDD in JCL


Please help me .
MANALI
INDIA

Manali
Member
Posts: 4
Joined: Fri Oct 22, 2010 11:50 am

Re: Merging three files using ICEtool - need help

Post by Manali » Fri Oct 22, 2010 8:06 pm

Can anybody help me on this ?? . I am not being able to get the solution and I have only one day to complete it.
MANALI
INDIA

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Sat Oct 23, 2010 12:55 am

I have only one day to complete it.
Then you should have spent more time explaining what you want to do as it's unclear.

If you're trying to join the records on the first two fields and include the other fields, you can use a DFSORT job like the following (however, I'm not really sure if that's what you want to do):

Code: Select all

//S1 EXEC PGM=SORT                         
//SYSOUT DD SYSOUT=*                       
//IN1 DD *                                 
a1 b1 c1 d1                                
a2 b2 c2 d2                                
a3 b3 c3 d3                                
a4 b4 c4 d4                                
//IN2 DD *                                 
a1 b1 e1 d1                                
a2 b2 e2 d2                                
a3 b3 e3 d3                                
a4 b4 e4 d4                                
//SORTOUT DD SYSOUT=*                      
//SYSIN DD *                               
  JOINKEYS F1=IN1,FIELDS=(1,5,A)           
  JOINKEYS F2=IN2,FIELDS=(1,5,A)           
  REFORMAT FIELDS=(F1:1,11,F2:6,3)         
  OPTION COPY                              
I have a date field in format CYYDDD . I need to convert it to the format YYYYMMDD in JCL
Telling us you have a CYYDDD format field doesn't tell us much since this isn't a standard format. Show an example of what the CYYDDD value looks like in hex. What can be in C?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Manali
Member
Posts: 4
Joined: Fri Oct 22, 2010 11:50 am

Post by Manali » Sun Oct 24, 2010 8:28 pm

Hi

Thank you so much for your help . But "JOINKEYS" not working in my application. My application is not upgraded with
installing PTF

ICETOOL is supported though.

Here I am explaining clearly the sample scenario.

My input Data sets are FB and LRECL = 50

account number field has unique occurrence in every file. Input file1 is the driving file. account number is the key.

If one account is not present in input file1 , that should not come in output.

In output file the format will be semicolon separated and one new field will be displayed having the logic below

if amount1>= 100
then new field =2
else
new field =1
endif



Input 1

acct no name amount amount1

001 abc +89.78 110
002 cdf -78.89 89
003 def +99.99 120
004 efg +0.00 5

file structure (lrecl=50 n FB)

001abc +89.78110
002cdf -78.8989
003def +99.99120
004efg +0.00 5



input 2

acct no addr someflag

001 abcd yes
002 cdfr no
003 defg yes
004 efgr yes

File Structure (lrecl=50 n FB)

001abcdyes
002cdfrno
003defgyes
004efgryes

input 3
acct no amount2

001 +1.00
002 -12.34

File Structure (lrecl=50 n FB)

001 +1.00
002 -12.34


Output file (FB)

acct no;name;addr;someflag;amount;amount1;amount2;"new field"

001;abc;abcd;yes;+89.78;110;+1.00;2
002;cdf;cdfr;no;-78.89;89;-12.34;1


Date conversion

example date field is 186031 (in CYYDDD format ) , where C = 1 if YY (i.e year) is less than or equal to 99 otherwise C=2

then 186031 stands for 31st jan 1986.
MANALI
INDIA

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Oct 25, 2010 10:09 pm

But "JOINKEYS" not working in my application. My application is not upgraded with installing PTF
Then I need to know what level you're at.

Run this job and show the //SYSOUT messages you receive:

Code: Select all

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Manali
Member
Posts: 4
Joined: Fri Oct 22, 2010 11:50 am

Post by Manali » Tue Oct 26, 2010 1:26 pm

Frank Yaeger wrote:
But "JOINKEYS" not working in my application. My application is not upgraded with installing PTF
Then I need to know what level you're at.

Run this job and show the //SYSOUT messages you receive:

Code: Select all

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*

ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 01:17 ON TUE O
OPTION COPY
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K48846 C6-K90014 C7-K45047 C8-K90014 E9-K40168 C9-BASE E5-K48846
ICE142I 0 SORTPRNT NOT FOUND - SYSOUT USED
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
MANALI
INDIA

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Oct 27, 2010 10:16 pm

Since you didn't use code tags, I can't tell what your data actually looks like. Please tell me the starting position, length and format of each field in each file.
If one account is not present in input file1 , that should not come in output.
Your example doesn't show this case. Please show a more extensive example with all possible variations (e.g. acct no in file1 that doesn't appear in the other files, acct no in file2 that doesn't appear in the other files, etc).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others