View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
Please give me the equivalent code in Syncsort for below Ezytrieve code.
Details:
IN-KEY1 - Starting position 12, length 8 - from file1.
IN-ACCT2 - Starting position 307, length 8 - from file1.
IN-KEY2 - Starting position 50, length 8 - from file2.
Code: |
JOB INPUT NULL
GET INFILE1
GET INFILE2
DO WHILE NOT EOF INFILE1
IF (IN-KEY1 = IN-KEY2) OR (IN-ACCT2 = IN-KEY2)
GOTO JOB
ELSE
PUT OUTFILE FROM INFILE1
GET INFILE1
END-IF
END-DO
STOP
|
Thanks. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Perhaps for the non programmers amongst us, it may be beneficial to actually explain what the program will achieve.
Take a long long look at the information that you have given us. Not a lot there really, is there ? We only joke about being psychic, we're not really psychic much at all.
So, using my brain I have thought about what people might just need to know about the problem in hand.
1) What exactly it is that you want to achieve.
2) Examples of the the input records.
3) What is the expected output.
4) What are the RECFM and LRECL of the input files.
5) What is the RECFM and LRECL of any output files.
6) Where in each record layout is the compare / key fields.
7) How long are these fields.
8) What format do these fields use.
9) And most important of all, which sort product do you use, as the solution may vary from product to product, so why let someone waste time developing a solution for you which will not work because it is for the wrong product. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Expat,
Not only do people want the forum to do their work for them, but now we've moved on to providing conversion service. . .
Not only "Give me", but now
Quote: |
Please give me the equivalent code in Syncsort for below Ezytrieve code. |
|
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi,
Quote: |
- The file1 LRECL is 400 and RECFM is FB. The file2 LRECL is 80 and RECFM is FB.
- Output LRECL is 80 and RECFM is FB.
- IN-KEY1 - Starting position 12, length 8 - from file1.
- IN-ACCT2 - Starting position 307, length 8 - from file1.
- IN-KEY2 - Starting position 50, length 8 - from file2.
- IN-KEY2 of file2 to be compared against IN-KEY1 and also IN-ACCT2 of file1 and unmatched value from file1 should be written to output file.
- The fields are character format.
- The product being used is Syncsort.
|
File1:
Code: |
AC200200 BK509809
AC345789 TM444441
|
file2:
Code: |
AC200200
AC345789
TM444441
|
Output:
Thanks. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is an example that you can use to convert the Ezytrieve application to SyncSort for z/OS:
Code: |
//S1 EXEC PGM=SORT
//SORTJNF1 DD *
AC200200 BK509809
AC345789 TM444441
//SORTJNF2 DD *
AC200200
AC345789
TM444441
//SORTOUT DD DSN=OUTPUT.FILE,DISP=(,CATLG)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,8)
SORT FIELDS=COPY
OUTREC OVERLAY=(80:X)
/*
//S2 EXEC PGM=SORT
//SORTJNF1 DD *
AC200200 BK509809
AC345789 TM444441
//SORTJNF2 DD *
AC200200
AC345789
TM444441
//SORTOUT DD DSN=OUTPUT.FILE,DISP=MOD
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(14,8,A)
JOINKEYS FILES=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:14,8)
SORT FIELDS=COPY
OUTREC OVERLAY=(80:X)
/* |
|
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Thanks Alissa. I will try this and come back. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Alissa, it is working as expected. Thanks once gain. |
|
Back to top |
|
|
|