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

[Solved]outrec syntax error


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Fri Jul 15, 2022 8:42 am
Reply with quote

Hi All,

I have input file having one record ,please see below.

****** *******************
000001 RITM0203049
****** *******************

Using sort i want to create a output file that i will use in other step for diffrent purpose. requirement is my output file content should look like below .

'PUT ''QSYS.SORT.RC.CODE'' /tmp/ndvr/RITM0203049.txt;'

exactly the content i want in my output file where if you notice RITM0203049 is the data from input file.

i am getting below error while doing it from outrec.

SYNCSORT FOR Z/OS 3.1.4.0R U.S. PATENTS: 4210961, 5117495 (C) 2018 SYNCSO
z/OS 2.4.0
Code:
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 13CD7, MODEL 8561 605             LICEN
 SYSIN :                                                                       
   SORT FIELDS=COPY                                                             
   OUTREC FIELDS=(01:C''PUT ''QSYS.SORT.RC.CODE'' /tmp/ndvr/',37:01,12,80:X)   
                      *                                                         
 WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED                 
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
 ******************************** END OF DATA **********************************

I tried multiple time and still couldn't find the error , can anyone give litlle hint here or check my sort card.

my sort card:

Code:
 SYSIN    DD  *                                                         
 SORT FIELDS=COPY                                                       
 OUTREC FIELDS=(01:C''PUT ''QSYS.SORT.RC.CODE'' /tmp/ndvr/',37:01,12,80:X)






Thanks.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Fri Jul 15, 2022 9:10 am
Reply with quote

Review your use of apostrophe
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Fri Jul 15, 2022 10:17 am
Reply with quote

At first, the input data is of length 11 not 12. Next point would be to read the Error Messages and try to find your mistake. As this is a very simple task, I give some help.
Code:
OPTION COPY                                       
INREC BUILD=(C'''PUT ''''QSYS.SORT.RC.CODE''''',X,
             C'/tmp/ndvr/',1,11,C'.txt;''',80:X) 
END

Output:
Code:
****** **************************** Datenanfang **************
000001 'PUT ''QSYS.SORT.RC.CODE'' /tmp/ndvr/RITM0203049.txt;'
****** **************************** Datenende ****************
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 141
Location: India

PostPosted: Fri Jul 15, 2022 3:07 pm
Reply with quote

Thanks a lot for reply ,
actually my output should be like below :not one which i gave previously by mistake i kept them in quotes.

PUT 'QSYS.SORT.RC.FAIL.CODE1' /tmp/ndvr/RITM0203050.txt

, i dont want you to give me sort card I know this is silly asking everything just tell me how every string is shown here .i.e every string should be closed with apostrophe..what is the syntax actually genral syntax for appending the string here.

i am getting syntax errors , if you have any doc to refer i will refer.

again just asking the syntax here ,


thanks a lot again
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Fri Jul 15, 2022 4:22 pm
Reply with quote

Please check the differences in specifying apostrophes.
Code:
OPTION COPY                                   
INREC BUILD=(C'PUT ''QSYS.SORT.RC.CODE''',X,   
             C'/tmp/ndvr/',1,11,C'.txt',80:X) 
END


From the DFSORT manual:

If you want to include a single apostrophe in the character string, you must specify it as two single apostrophes. Thus: Required: O'NEILL Specify: C'O''NEILL'
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Jul 15, 2022 9:29 pm
Reply with quote

Moved to Students Section.
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 -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top