Using a symbolic name in an INCLUDE statement

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
migusd
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Skillset: jcl
Referer: by the web

Using a symbolic name in an INCLUDE statement

Postby migusd » Thu Dec 18, 2014 3:54 am

Hi guys,
is it possible to use a symbolic name in an include?
So far, my attempts are failing.

I am using symbolic names because most fields are variable length.
I want to compare only the first bytes of the field.

here is my code.
this is in symnames
CKEY,1,8
FLD2,%00
FLD3,%01
FLD4,%02
PIPE,'|'
BLNK,' '


and this is the actual code

Code: Select all

  SYSIN :                                                                         
  * SORT FIELDS=COPY                                                               
    INREC PARSE=(FLD2=(ABSPOS=10,FIXLEN=8,ENDBEFR=BLNK),                           
                 FLD3=(FIXLEN=13,ENDBEFR=BLNK),                                   
                 FLD4=(FIXLEN=11,ENDBEFR=BLNK)),                                   
    BUILD=(CKEY,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4,PIPE)                               
    SORT FIELDS=COPY                                                               
    INCLUDE COND=(FLD3,04,CH,EQ,C'RACF')                                           
  DATA DICTIONARY SYMBOLS SUBSTITUTED :                                           
  INREC PARSE=(%00=(ABSPOS=10,FIXLEN=8,ENDBEFR=C' '),%01=(FIXLEN=13,ENDBEFR=C' '),
  %02=(FIXLEN=11,ENDBEFR=C' ')),BUILD=(1,8,C'|',%00,C'|',%01,C'|',%02,C'|')       
  SORT FIELDS=COPY                                                                 
  INCLUDE COND=(%01,04,CH,EQ,C'RACF')                                             
                *                                                                 
  WER268A  INCLUDE STATEMENT : SYNTAX ERROR                                       
  WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                   


how can I fix this?

Thanks

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: Using a symbolic name in an INCLUDE statement

Postby BillyBoyo » Thu Dec 18, 2014 5:07 am

A couple of problems. No matter the order you code them, they are going to run like this:

Code: Select all

INCLUDE ....
INREC ....


If you look at the documentation of symbols, I doubt you'll find anything which will allow you to use them like that. You can't make the start position of a field "variable".

You can use a symbol in an INCLUDE/OMIT. You can't use it there. You can't use a PARSEd field, because INREC, the earliest point you can use PARSE, runs after INCLUDE/OMIT.

If you show a sample of your data, expected output and what it is you are trying to achieve, we may have some suggestions. You can't do it how you are attempting it.

migusd
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Skillset: jcl
Referer: by the web

Re: Using a symbolic name in an INCLUDE statement

Postby migusd » Thu Dec 18, 2014 8:29 am

thanks Billy,
I made a mistake when I swap the INCLUDE & INREC statements.

I think is better to do it in separate steps.

Thanks

Miguel

migusd
Posts: 40
Joined: Tue Dec 01, 2009 9:26 pm
Skillset: jcl
Referer: by the web

Re: Using a symbolic name in an INCLUDE statement

Postby migusd » Thu Dec 18, 2014 8:47 am

having said that,
what I was really after (or what I should have done) is to use the INCLUDE in the OUTFIL statement.
attempting that... with the symbolic reference...

think of data
date 2014-12-08
12345678 lucas racf38978 actionx
98765432 recorch3 window3 actiony
23456789 outhandle racf8978 actionz
87654321 zap linux387 actionx

I only care about the racf in third field.
not sure if the BUILD is necessary here.

so the end data should look like this
12345678|lucas|racf38978|actionx|2014-12-08|
23456789|outhandle|racf8978|actionz|2014-12-08|

but haven't finished. in fact, I started with an imcomplete model.
I guess I should go with the INREC IFWHEN=GROUP to get the date from header record first...
so... working on it...

Thanks Billy


  • Similar Topics
    Replies
    Views
    Last post