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
 

 

Checking for trailer and setting return code

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

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Feb 20, 2014 7:28 pm    Post subject: Checking for trailer and setting return code
Reply with quote

In my input file i need to check if trailer record is present or not.If trailer record is present i need to set return code as 0 else 12

if frist two bytes are 09 then its trailer record

I am using below code

Code:
//SORTIN   DD DISP=SHR,DSN=WIPR.EXTW131.PAD.TRAIL.CHK 
//*                                                   
//SYSIN    DD *                                       
 SORT FIELDS=COPY                                     
 INREC IFTHEN=(WHEN=INIT,RC12),                       
       IFTHEN=(WHEN=(01,2,CH,EQ,C'09'),RC00)           
*  OUTREC BUILD=(1,80)                                 
/*               



Getting below error

Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 15:46 ON
           SORT FIELDS=COPY                                             
           INREC IFTHEN=(WHEN=INIT,RC12)                                 
                                   $                                     
ICE006A 0 OPERAND DEFINER ERROR                                         
                 IFTHEN=(WHEN=(01,2,CH,EQ,C'09'),RC00)                   
                 $                                                       
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY   
          *  OUTREC BUILD=(1,80)                                         
ICE056A 1 SORTOUT  NOT DEFINED                                           
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E7-K70685     
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Feb 20, 2014 7:44 pm    Post subject: Reply to: Checking for trailer and setting return code
Reply with quote

Unfortunately, if you just invent syntax, it rarely does what you want.

There are examples here of setting the Return Code. Documentation in the manuals. Have a search/read and a genuine attempt at it. If still stuck, come back again.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Thu Feb 20, 2014 7:54 pm    Post subject:
Reply with quote

Try this

Code:
//STEP0100 EXEC PGM=ICETOOL
//SYSOUT   DD SYSOUT=*
//SIN1     DD DSN=INPUTFILE,DISP=SHR
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//TOOLIN   DD *
  COUNT FROM(SIN1) EMPTY USING(CTL1)
//CTL1CNTL DD *
  SORT FIELDS=COPY
  INCLUDE COND=(1,2,CH,EQ,C'02')


Note: Did a small change as EMPTY returns RC=12
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 Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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