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

Ezytrieve equal code in Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Nov 04, 2009 7:00 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 04, 2009 7:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 04, 2009 9:10 pm
Reply with quote

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.


icon_rolleyes.gif
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Nov 04, 2009 9:25 pm
Reply with quote

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:
Code:

BK509809


Thanks.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Nov 04, 2009 10:27 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Nov 05, 2009 3:36 pm
Reply with quote

Thanks Alissa. I will try this and come back.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Nov 05, 2009 3:54 pm
Reply with quote

Alissa, it is working as expected. Thanks once gain.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top