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 .
Merging three files using ICEtool - need help
Moderators: Frank Yaeger, Moderator Group
Merging three files using ICEtool - need help
MANALI
INDIA
INDIA
Re: Merging three files using ICEtool - need help
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
INDIA
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Then you should have spent more time explaining what you want to do as it's unclear.I have only one day to complete it.
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
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?I have a date field in format CYYDDD . I need to convert it to the format YYYYMMDD in JCL
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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.
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
INDIA
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Then I need to know what level you're at.But "JOINKEYS" not working in my application. My application is not upgraded with installing PTF
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Frank Yaeger wrote:Then I need to know what level you're at.But "JOINKEYS" not working in my application. My application is not upgraded with installing PTF
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
INDIA
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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.
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).If one account is not present in input file1 , that should not come in output.
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page