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

Problem in using multiple IFTHEN statements with INREC


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

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Mon Nov 10, 2008 7:05 pm
Reply with quote

Hi All

I tried to use the below sort card for removing upto 5 leading spaces in the field starting at 47 posotion and of length = 19 bytes.

Code:

// ' INREC  IFTHEN=(WHEN=(47,5,CH,EQ,C''     ''),           ',
// '      OVERLAY=(47:52,14,61:C''     ''))                 ',
// '        IFTHEN=(WHEN=(47,4,CH,EQ,C''    ''),            ',
// '      OVERLAY=(47:51,15,62:C''    '')),                 ',
// '        IFTHEN=(WHEN=(47,3,CH,EQ,C''   ''),             ',
// '      OVERLAY=(47:50,16,63:C''   '')),                  ',
// '        IFTHEN=(WHEN=(47,2,CH,EQ,C''  ''),              ',
// '      OVERLAY=(47:49,17,64:C''  '')),                   ',
// '       IFTHEN=(WHEN=(47,1,CH,EQ,C'' ''),                ',
// '      OVERLAY=(47:48,18,65:C'' '')),                    ',


But i'm gettin the below error:


Code:


 INREC  IFTHEN=(WHEN=(47,5,CH,EQ,C'     '),     
      OVERLAY=(47:52,14,61:C'     '))           
        IFTHEN=(WHEN=(47,4,CH,EQ,C'    '),       
        *                                       
      OVERLAY=(47:51,15,62:C'    ')),           
      *                                         
        IFTHEN=(WHEN=(47,3,CH,EQ,C'   '),       
        *                                       
      OVERLAY=(47:50,16,63:C'   ')),             
      *                                         
        IFTHEN=(WHEN=(47,2,CH,EQ,C'  '),         
        *                                 
      OVERLAY=(47:49,17,64:C'  ')),       
      *                                   
       IFTHEN=(WHEN=(47,1,CH,EQ,C' '),   
       *                                 
      OVERLAY=(47:48,18,65:C' ')),       
      *                                   

WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT   


Can anybody help on this ?
Is there an alternative way of doing this using SYNCSORT. Please advice
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Nov 10, 2008 10:11 pm
Reply with quote

leo_sangha,

If you have the latest version of Syncsort ( Release 1.3 ), I think you can do that by making use of the SQZ parameter.

If you dont have the latest version, you can follow with the current approach. But I see the "," missing before the second IFTHEN.
Quote:
OVERLAY=(47:52,14,61:C' ')),

Also you need a SORT FIELDS=(x,y,z....) or an OPTION COPY statement.
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Tue Nov 11, 2008 3:48 pm
Reply with quote

arcvns, thanks.

I would like to know more about SQZ. I think our shop has SYNCSORT FOR Z/OS 1.2.2.3R installed. Is the one you pointed out ?

It was missing comma. Below sort card is working fine now.

Code:

// ' INREC  IFTHEN=(WHEN=(47,5,CH,EQ,C''     ''),           ',
// '      OVERLAY=(47:52,14,61:C''     '')),                 ',
// '        IFTHEN=(WHEN=(47,4,CH,EQ,C''    ''),            ',
// '      OVERLAY=(47:51,15,62:C''    '')),                 ',
// '        IFTHEN=(WHEN=(47,3,CH,EQ,C''   ''),             ',
// '      OVERLAY=(47:50,16,63:C''   '')),                  ',
// '        IFTHEN=(WHEN=(47,2,CH,EQ,C''  ''),              ',
// '      OVERLAY=(47:49,17,64:C''  '')),                   ',
// '       IFTHEN=(WHEN=(47,1,CH,EQ,C'' ''),                ',
// '      OVERLAY=(47:48,18,65:C'' ''))                    ',
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Nov 11, 2008 6:10 pm
Reply with quote

leo_sangha,
Quote:

It was missing comma. Below sort card is working fine now.

Good to hear it's working now icon_smile.gif

Quote:
I would like to know more about SQZ. I think our shop has SYNCSORT FOR Z/OS 1.2.2.3R installed. Is the one you pointed out ?

Nope, The latest release is Syncsort for z/OS Release 1.3. Here's some brief description of the parameter.
Syncsort for z/OS Release 1.3 manual wrote:
The SQZ Subparameter
The SQZ subparameter specifies the following basic operations:
• All blank characters in the input field are eliminated.
• If left-shifting is specified, the remaining characters are shifted left; any necessary blanks are introduced on the right.
• If right-shifting is specified, the remaining characters are shifted right; any necessary blanks are introduced on the left.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top