Page 1 of 1

JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Wed Jul 18, 2018 10:14 pm
by tslmsumm
I have 2 data sets. Data set A & data setB. If the key from data set A is found in data set B, I want to set an indicator on the end of data set A.

data set A (LRECL):
12345AAA
12445DDD
32445BBB
67888CCC


data set B:
12345
67888


If the 1st 5 positions from data set A are in data set B then I want to add an indicator to the end of the record in data set A, like so:
data set A:
12345AAAY
12445DDD
32445BBB
67888CCCY
 

I've looked at several examples and methods but it is still not working properly.
//STEP40   EXEC SORTD,CYLS=1000                                
//SYSOUT   DD SYSOUT=*                                        
//SORTJNF1 DD DSN=data set A,                          
//             DISP=(OLD,CATLG,KEEP)                          
//SORTJNF2 DD DSN=data set B,                          
//             DISP=(OLD,CATLG,KEEP)                          
//OUTFILE  DD DSN=data set C,                          
//             DISP=(NEW,CATLG,KEEP),                          
//             DCB=(DSORG=PS,RECFM=FB,LRECL=9,BLKSIZE=0),    
//             SPACE=(CYL,(1000,1000),RLSE),                  
//             UNIT=DISK                                      
//SYSIN    DD *                                                
     JOINKEYS FILES=F1,FIELDS=(1,5,A),SORTED,NOSEQCK        
     JOINKEYS FILES=F2,FIELDS=(1,5,A),SORTED,NOSEQCK          
     JOIN UNPAIRED,F1                                          
     REFORMAT FIELDS=(F1:1,9,?)                              
     OPTION COPY                                              
     OUTFILE IFTHEN=(WHEN=(9,1,CH,EQ,C'B'),OVERLAY=(9:C'Y'))
/*                              


Do I have to send my output to data set C or can I just append to end of data set A?
When I originally create data set A in STEP20, do I need to add a position on to the end? Do I need to make it 9?

If anyone can help, I would greatly appreciate it.
Thx in advance.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Thu Jul 19, 2018 2:11 pm
by NicC
This is not a JCL question but a Syncsort question. Topic move to Syncsort part of the forum. Slight editing done. tslmsumm, please carefully note the changes that were made.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Mon Jul 23, 2018 11:57 pm
by tslmsumm
Thanks. How long does it typically take to get a response on this forum?

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Tue Jul 24, 2018 12:11 am
by prino
tslmsumm wrote:Thanks. How long does it typically take to get a response on this forum?

Given this extremely arrogant question, I'd say:

"For you: Never!"

and I hope the other people who give their time freely on this forum will have the same attitude!

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Tue Jul 24, 2018 12:38 am
by Robert Sample
How long does it typically take to get a response on this forum?
This is a volunteer forum -- as in, responses are posted when people have the time and interest and knowledge to respond. Typical responses can range from minutes to hours to days to weeks to years -- and any of these time frames will be normal. Prompting for responses as you did, however, tends to slow down responses since those people who would have responded decide it's not worth the hassle of responding.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Tue Jul 24, 2018 1:41 am
by steve-myers
tslmsumm wrote:Thanks. How long does it typically take to get a response on this forum?
It varies. I looked at the logged time for your initial request and the logged time for the response: it came to not quite 16 hours. It then took you several days to make an extremely rude response to the post!

Personally I regard your request to be in the nature of do my work for me, rather than a request for assistance.

Now I am not qualified to either assist you or to do your work for you; I rarely use sort products for anything. I think it's been 10 years since I used a sort product.

If you want people to do your work for you then you had better be prepared to pay the going rate for consulting, because that's what it will take. Good luck.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Tue Jul 24, 2018 11:03 pm
by tslmsumm
I'm sorry, did not mean to offend anyone. Just frustrated... all I am looking for is someone who might know what I'm doing wrong... I don't want anyone to do any of my work for me. Just looking for help. I honestly have never posted on a site like this before and wasn't sure what to expect. I found other people posting things and asking similar questions, so I didn't think it was too much to ask. I'll keep trying somewhere else.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Tue Jul 24, 2018 11:48 pm
by Robert Sample
Do I have to send my output to data set C or can I just append to end of data set A?
Modifying your input data set is not generally recommended in case of reruns.
When I originally create data set A in STEP20, do I need to add a position on to the end? Do I need to make it 9?
All you provided us is STEP40 -- what happens in STEP20? We really cannot comment upon unseen code.

So you provided partial information, expected us to figure out what you did not provide, and then got impatient when nobody responds within a few days? Perhaps you should Google how to ask good questions (there are about 994,000,000 results for that, by the way). Fairly often, a lack of responses indicates that the question posed was not well-thought-out or was incomplete and hence the person posting should review what was posted. Oh, and I just checked -- there are over 500 posts that have NEVER had an answer (some going back to 2007), so it cannot considered unusual for a post to never be answered.

Re: JCL Syncsort Match and Flag in 1 of 2 files

PostPosted: Wed Jul 25, 2018 12:44 am
by tslmsumm
The only thing that happened in previous steps were the creation of Dataset A and B, which I outlined. I don't think asking if I needed to account for the additional space that I'm adding in STEP40 in STEP20 is an incomplete question. Thank you for your time and response.

Since you were so helpful to me, I'm going to return the favor: here are some Google searches that may benefit you:
"How to answer a question" - 1.1 billion results
"How to accept an apology" - 34.3 million results
"How to forgive and forget" - 74.2 million results
"How to read between the lines" - 635 million results