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
 

 

FINDREP Syntax Error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 52
Location: Cochin

PostPosted: Thu Mar 09, 2017 10:11 pm    Post subject: FINDREP Syntax Error
Reply with quote

Hi Team,

I am facing an issue with FINDREP while trying to replace a text with number.

I have two texts in my input file namely - YYYYMMDD and HHMMSS which I am trying to replace with the value returned from the date time variables - &DATE1 AND &TIME1, but when I run the job its giving me SYNTAX error.
Can you please let me know how to achieve this ?

SYSIN:
Code:

//SYSIN    DD    *                                           
  SORT FIELDS=COPY                                           
  INREC FINDREP=(INOUT=(C'YYYYMMDD',&DATE1,C'HHMMSS',&TIME1))


Note: Instead of &DATE1 if I am using another string it works fine.
Back to top
View user's profile Send private message

Arun Raj

Moderator


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

PostPosted: Thu Mar 09, 2017 10:34 pm    Post subject:
Reply with quote

How about using INREC IFTHEN to OVERLAY current date/time based on input position, instead of FINDREP.

FINDREP is used to find and replace constants within the input data record.

FINDREP Output Constant Rules wrote:
An output constant can be specified as a null string, a single character string, a repeated character string, a single hexadecimal string, or a repeated hexadecimal string. The syntax is: C'' (null), C'string',nC'string', X'string' or nX'string'. n can be 1 to 256.


IIRC current date/time constants can be 'inserted' only with INREC/OUTREC/OUTFIL BUILD or OVERLAY parameters.
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 52
Location: Cochin

PostPosted: Thu Mar 09, 2017 11:15 pm    Post subject:
Reply with quote

Arun Raj wrote:
How about using INREC IFTHEN to OVERLAY current date/time based on input position, instead of FINDREP.

FINDREP is used to find and replace constants within the input data record.

FINDREP Output Constant Rules wrote:
An output constant can be specified as a null string, a single character string, a repeated character string, a single hexadecimal string, or a repeated hexadecimal string. The syntax is: C'' (null), C'string',nC'string', X'string' or nX'string'. n can be 1 to 256.


IIRC current date/time constants can be 'inserted' only with INREC/OUTREC/OUTFIL BUILD or OVERLAY parameters.


Thanks for the info. I have the solution using overlay, but I want to make it more generic and not based on static position. Thought FINDREP could be used, but it seems I have to go back to overlay method if this is not going to work icon_sad.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Mar 10, 2017 12:06 am    Post subject:
Reply with quote

Well then you can use dynamic system symbols in your SYMNAMES and use those symbols in your FINDREP.

Something like this:
Code:
//STEP01   EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SYMNAMES DD *                                         
DATE-IN,S'&LYR4.&LMON.&LDAY.'                             
TIME-IN,S'&LHHMMSS.'                                   
//SORTOUT  DD SYSOUT=*                                 
//SORTIN   DD *                                         
CON1-CON2                                               
//SYSIN    DD *                                         
 OPTION COPY                                           
 INREC FINDREP=(INOUT=(C'CON1',DATE-IN,C'CON2',TIME-IN))

SORTOUT
Code:
20170309-134023
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 52
Location: Cochin

PostPosted: Fri Mar 10, 2017 12:37 am    Post subject:
Reply with quote

Arun Raj wrote:
Well then you can use dynamic system symbols in your SYMNAMES and use those symbols in your FINDREP.

Something like this:
Code:
//STEP01   EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SYMNAMES DD *                                         
DATE-IN,S'&LYR4.&LMON.&LDAY.'                             
TIME-IN,S'&LHHMMSS.'                                   
//SORTOUT  DD SYSOUT=*                                 
//SORTIN   DD *                                         
CON1-CON2                                               
//SYSIN    DD *                                         
 OPTION COPY                                           
 INREC FINDREP=(INOUT=(C'CON1',DATE-IN,C'CON2',TIME-IN))

SORTOUT
Code:
20170309-134023


You are Awesome! Thanks a ton Arun icon_smile.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am


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