Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Issue with SYMBOLS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sun Nov 25, 2012 5:26 pm    Post subject: Issue with SYMBOLS
Reply with quote

Hi,

I am using the following SORT Card

Code:
  SORT FIELDS=(1,22,CH,A)                                         
  SUM FIELDS=NONE                                                 
  JOINKEYS FILES=F1,FIELDS=(1,22,A)                               
  JOINKEYS FILES=F2,FIELDS=(1,22,A)                               
  REFORMAT FIELDS=(F2:1,BSLEN)                                   
  OUTFIL FNAMES=SORTOUT,REMOVECC,                                 
          IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),                       
                  BUILD=(1:C'H',23,4,PD,TO=ZD,LENGTH=7,BSLEN:X)),
          IFTHEN=(WHEN=(1,3,CH,NE,C'000',AND,1,3,CH,NE,C'999'),   
                  BUILD=(1:1,BSLEN)),                             
          TRAILER1=(C'T',COUNT-1=(M11,LENGTH=8))                 


BSLEN is defined in SYMNAMES as value 10562.

Code:
DATA DICTIONARY SYMBOLS SUBSTITUTED :                                         
SORT FIELDS=(1,22,CH,A)                                                       
SUM FIELDS=NONE                                                               
JOINKEYS FILES=F1,FIELDS=(1,22,A)                                             
JOINKEYS FILES=F2,FIELDS=(1,22,A)                                             
REFORMAT FIELDS=(F2:1,BSLEN)                                                   
         *                                                                     
OUTFIL FNAMES=SORTOUT,REMOVECC,IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),BUILD=(1:C'H',23
4,PD,TO=ZD,LENGTH=7,10562:X)),IFTHEN=(WHEN=(1,3,CH,NE,C'000',AND,1,3,CH,NE,C'99
'),BUILD=(1:1,BSLEN)),TRAILER1=(C'T',COUNT-1=(M11,LENGTH=8))                   
          *                                                                   
WER268A  REFORMAT STATEMENT: SYNTAX ERROR                                     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE           


Can any one help with what is wrong with the SYNTAX?

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sun Nov 25, 2012 6:05 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

You have SyncSort. Please be careful about this, as time has to now be spent moving all your stuff out of the DFSORT forum to here.

Please find out how to use the Code tags and the Preview button. Then use them, always.

What are you trying to do? Why did you think you can include a "constant" in a REFORMAT statement and what was that BUILD supposed to be?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sun Nov 25, 2012 6:11 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

I have to use this control card in many steps, only difference is the Length (that I am trying to use as a constant here) varies. In order to avoid coding mutiple cards, I thought of having one common and using SYMBOLS.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sun Nov 25, 2012 6:27 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

The "length" of what?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sun Nov 25, 2012 6:34 pm    Post subject:
Reply with quote

Length of the file.

I am pasting the JCL here: -

Code:
//PS020    EXEC PGM=SORT                               
//*                                                     
//*                                                     
//SYSPRINT DD SYSOUT=&NOPRINT                           
//SYSOUT   DD SYSOUT=&NOPRINT                           
//SORTJNF2 DD DSN=Input File 2
//            DISP=SHR                                 
//SORTJNF1 DD DSN=Input File 1,DISP=SHR
//*                                                     
//SORTOUT  DD DSN=Output File
//            DISP=(NEW,CATLG,DELETE),                 
//            DSORG=PS,                                 
//            SPACE=(CYL,(50,50),RLSE),                 
//            RECFM=FB,LRECL=[color=red][b]10562                      [/b][/color]
//*                                                     
//SYSPRINT DD SYSOUT=&NOPRINT                           
//SYSOUT   DD SYSOUT=&NOPRINT                           
//SYSUDUMP DD SYSOUT=&DUMP                             



The Input File 1 lvaries everytime and it length varies. The output file length should match with that of input file 1. In this particular case, the input file length is 10562. So I want to pass this 10562 in the SORT CARD as a constant.

Code'd, yet again
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sun Nov 25, 2012 7:59 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

You are still not Code'ing your posts. It makes it easier for people to help you if they can see everything lined-up correctly. If you continue to ignore this, you'll probably get less help.

The record-length in Sort doesn't work in the way you think it does.

What you do is place the RDW from your variable input file into position 1 in the output file(s).

Code:
  BUILD=(1,4,C'XXXXX',5)


This will copy the RDW, put five Xs in data-positions 1-5, and follow that with the variable-length intput record (from position 5, in this case, to the end of the current record). Sort will take care of the output record-length from the data that you provide, or the presence of IFOUTLEN.

If you leave the DCB information off the output files, Sort will supply it automatically.
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Mon Nov 26, 2012 11:09 pm    Post subject:
Reply with quote

I defined another SYMBOL BSLEN1,1,10562 and used in the places where there is an error. It worked fine.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Nov 26, 2012 11:22 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

Code:
BSLEN1,1,10562


Well, if that is what you have coded and you are happy, then fine.

However, again, what do you think the above does?

Have you included
Code:
//SYMNOUT DD SYSOUT=*
in your JCL?

Can you paste the contents of SYMNOUT and the full sysout from your step, please?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Mon Nov 26, 2012 11:35 pm    Post subject:
Reply with quote

SYSOUT

Code:
SYSIN :                                                                       
  SORT FIELDS=(1,22,CH,A)                                               
  SUM FIELDS=NONE                                                       
  JOINKEYS FILES=F1,FIELDS=(1,22,A)                                     
  JOINKEYS FILES=F2,FIELDS=(1,22,A)                                     
  REFORMAT FIELDS=(F2:BSLEN1)                                           
  OUTFIL FNAMES=SORTOUT,REMOVECC,                                       
          IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),                             
                  BUILD=(1:C'H',23,4,PD,TO=ZD,LENGTH=7,BSLEN:X)),       
          IFTHEN=(WHEN=(1,3,CH,NE,C'000',AND,1,3,CH,NE,C'999'),         
                  BUILD=(1:BSLEN1)),                                   
          TRAILER1=(C'T',COUNT-1=(M11,LENGTH=8))           

SYMNOUT

[code]****** SYMNAMES SYMBOL STATEMENTS ******
 BSLEN,10562                             
 BSLEN1,1,10562                         
********** SYMBOL DEFINITIONS **********
BSLEN,10562                             
BSLEN1,1,10562                           [/code]             
DATA DICTIONARY SYMBOLS SUBSTITUTED :                                         
SORT FIELDS=(1,22,CH,A)                                                       
SUM FIELDS=NONE                                                               
JOINKEYS FILES=F1,FIELDS=(1,22,A)                                             
JOINKEYS FILES=F2,FIELDS=(1,22,A)                                             
REFORMAT FIELDS=(F2:1,10562)                                                   
OUTFIL FNAMES=SORTOUT,REMOVECC,IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),BUILD=(1:C'H',23,
4,PD,TO=ZD,LENGTH=7,10562:X)),IFTHEN=(WHEN=(1,3,CH,NE,C'000',AND,1,3,CH,NE,C'999
'),BUILD=(1:1,10562)),TRAILER1=(C'T',COUNT-1=(M11,LENGTH=8))                   
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 27, 2012 2:17 am    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

You're getting File 2 records which match on File 1.

F2-INPUT-RECORD,1,10562,CH
F2-INPUT-RECORD-LAST-BYTE,10562,1,CH

Code:


  JOINKEYS FILES=F1,FIELDS=(1,22,A)                                     
  JOINKEYS FILES=F2,FIELDS=(1,22,A)                                     
  REFORMAT FIELDS=(F2:F2-INPUT-RECORD)                                           
  OUTFIL FNAMES=SORTOUT,REMOVECC,                                       
          IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),                             
                  OVERLAY=(1:C'H',23,4,PD,TO=ZD,LENGTH=7)),       
          TRAILER1=(C'T',COUNT-1=(M11,LENGTH=8))           
  MERGE FIELDS=(1,22,CH,A)                                               
  SUM FIELDS=NONE                                                       


If you input records are 10562, then the above should do you. For the "header" you are creating, just OVERLAY what you want, unless you have a need to blank the rest of record, in which case

Code:
OVERLAY=(1:C'H',23,4,PD,TO=ZD,LENGTH=7,F2-INPUT-RECORD-LAST-BYTE:X)),


For the non 000 records, you have the entire record already sitting there, so no need to BUILD anything (as you're not changing anything).

You are putting a TRAILER1 trailer on, but leaving the 999 record, I assume that is what you want.

It doesn't matter where you physically put the SORT and SUM, they will operate after the JOINKEYS has run. Since your file is then in key order, no need to sort it again.
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Nov 27, 2012 9:14 am    Post subject:
Reply with quote

Thanks Bill. It worked fine and I could also some improvement in Elapsed Time.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 27, 2012 1:25 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

Well, it's is doing one fewer sorts, and not having to do one 10k move per all data records.

Are your input files in key order?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Nov 27, 2012 1:38 pm    Post subject:
Reply with quote

Yes input files are in Key order
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 27, 2012 1:40 pm    Post subject: Reply to: Issue with SYMBOLS
Reply with quote

So, if you attach ",SORTED" to each of your JOINKEYS, you'll get rid of two more sorts, with further improvement in cpu/elapsed time.
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Nov 27, 2012 1:53 pm    Post subject:
Reply with quote

Having tried SORTED with JOINKEYS, it had further improved the performance.

Thanks for the help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts REXX Screen not working due to LINKED... sundarkudos CLIST & REXX 1 Mon May 09, 2016 1:44 pm
No new posts Issue in sending zip file as mail att... ajithajt JCL & VSAM 8 Thu Apr 07, 2016 9:11 am
No new posts Include Cond issue vickey_dw DFSORT/ICETOOL 6 Tue Mar 29, 2016 8:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us