1. Every Record with XXXXXX should have a matching YYYYYYY
2. YYYYYYY record should have numeric value < 40
"XXXXXX 2222222" record was omitted because there was no matching YYYYYYY record following it . "XXXXXX 4444444" was omitted because the following YYYYYYY record had value 50 (> 30).
EDIT: Code'd
Welcome to the forums, you could do this by defining 'GROUPS' starting with XXXXXX, and PUSH the '1111111' field across the GROUP.
In the output, INCLUDE only 'YYYYYYY' records with a 'good' numeric value, write the 'PUSH'ed field and the numeric field.
Extra note:
After 'YYYYYYY' record with 'bad' numeric value the previously PUSHed value needs to be erased to terminate the 'bad' group (or "re-PUSHed", with blanks, or whatever), until new 'XXXXXXX' record is found.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Quote:
Can you please provide an example for defining GROUPS with PUSH.
Plenty of examples in the forum. Use the Search function. I used keywords GROUP and PUSH and searched only the SYNCSORT section of the forum and about the second result had an example.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sergeyken wrote:
Extra note:
After 'YYYYYYY' record with 'bad' numeric value the previously PUSHed value needs to be erased to terminate the 'bad' group (or "re-PUSHed", with blanks, or whatever), until new 'XXXXXXX' record is found.
I don't think this is required. Also you don't really need an END-check.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sancraig16 wrote:
Criteria for selection :
1. Every Record with XXXXXX should have a matching YYYYYYY
As per the OPs requirement, XXXXXX may or may not have a matching YYYYYYY. Not the other way around. Your input shows multiple consecutive Y-records which is not in line with OP's sample data.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sancraig16,
Can you post the complete error message along with your control statements when you attempted to use 'CONVERT'? I don't see it in your last post.
Also include your input an output data set attributes (LRECL, RECFM ..).
WER813I INSTALLATION OPTIONS IN DDT LOAD LIBRARY WILL BE USED
WER276B SYSDIAG= 12598112, 32499117, 32499117, 41651540
WER164B 6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 12K BYTES RESERVE REQUESTED, 1,004K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VBA ; LRECL= 125; BLKSIZE= 27998
WER073I SORTIN : DSNAME=SMD.DATASET.SYSPRINT
WER257I INREC RECORD LENGTH = 125
WER235A SORTOUT OUTREC RDW NOT INCLUDED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
CONVERT will not give a JCL error - bad JCL will give a JCL error. JCL knows nothing about utility control statements. Furthermore, SYNCSORT messages begin with WER. The message you posted is neither a JCL message nor a Syncsort message. I suspect it is some sort of JCL checker message. Try running the JCL and give us the real messages.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sancraig16,
Since the input data set is VB, you might want to include the PUSH-ed fields at the beginning of the record at pos-5(considering the RDW).
For your CONVERT, you could do your IFTHEN BUILDs in an OUTREC IFTHEN and do the CONVERT and INCLUDE in the OUTFIL.
This is UNTESTED, but should give you something to start with. Good luck!
It worked. Thank you !!
I added an IFTHEN for FINDREP on the existing INREC to remove the ')'
I then added BUILD with CONVERT to the existing OUTFIL to include only the data I needed.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sancraig16 wrote:
It worked. Thank you !!
I added an IFTHEN for FINDREP on the existing INREC to remove the ')'
I then added BUILD with CONVERT to the existing OUTFIL to include only the data I needed.