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

Set a RETURN CODE of 04 in job if field is not numeric


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Aug 18, 2006 5:41 pm
Reply with quote

Hi,

I was wondering if there is a way to set the RETURN CODE to a job to 04 (as an example) if a specific field on the record is not numeric.

Let's say you have a file and in position 1 for a length of 10, you expect it to be numeric. When you check the value and it's not numeric, you want to set the return code to 04 to issue a warning to let someone know that there may be an issue with the file.

Thx!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 18, 2006 6:02 pm
Reply with quote

What would be the format of the field (Packed Decimal, Zoned Decimal, Binary, etc.)?
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Aug 18, 2006 7:37 pm
Reply with quote

It's ZD. But regardless of he format, it would be nice if there is a way to check a field for a value and depending on the criteria, you can set the return code in the job.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 18, 2006 10:38 pm
Reply with quote

What do you consider to be "not numeric" for a ZD field?

What do you consider to be "not numeric" for a PD field?

Does the data set contain one record, or more than one record? If the data set contains more than one record, do you want to set a non-zero return code if any record has a "not numeric" value?
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Mon Aug 21, 2006 5:59 pm
Reply with quote

Hi Frank,

Here is the sample data:

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+-
********************************* Top of Data ********************
HDRXXXX100XXXXXXXX20060821081912                                 
IRO   200606059999-1001       1026259        001828      000000003
IRO   200606059999-1001                      008247      000000000


There are 3 consecutive fields that should be numeric but they also contain spaces (which is considered valid).

@24 FIELD1 14(bytes)
@38 FIELD2 14(bytes)
@52 FIELD3 6(bytes)

These 3 fields need to be checked to see if they are numeric or not. Spaces is considered numeric in this instance. I could set zeroes into those fields by replacing all spaces with zeores and then check for numeric. But what I eventually want to do is, if any of those fields are not numeric, then I would like to set a return code 04 to the job to warn the user that there are non-numeric values in the fields.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 21, 2006 8:52 pm
Reply with quote

So by numeric you mean a blank or a '0'-'9' in every byte?

And for the example shown, you would consider all of the values to be valid numeric and want a RC=0?

Please show an example of an input record where you would want a RC=4.
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Mon Aug 21, 2006 11:12 pm
Reply with quote

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+-
********************************* Top of Data ********************
HDRXXXX100XXXXXXXX20060821081912                                 
IRO   200606059999-1001     X 1026259        001828      000000003
IRO   200606059999-1001                      008247   X  000000000

any other character other than space '0' thru '9' would be invalid.
I just added an 'X' in one of the fields for each record above...
Thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Aug 22, 2006 1:09 am
Reply with quote

Here's a DFSORT/ICETOOL job that will do what I think you asked for. If any record has a non-numeric value in your specified fields, the ICETOOL step will pass back RC=4. Otherwise, it will pas back RC=0.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) NOTEMPTY RC4
/*
//CTL1CNTL DD *
* Change spaces to '0's.
  ALTSEQ CODE=(40F0)
  INREC OVERLAY=(24:24,34,TRAN=ALTSEQ)
* Include any record with non-numeric values.
  OUTFIL FNAMES=T1,INCLUDE=(24,34,FS,NE,NUM)
/*
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Aug 25, 2006 5:55 pm
Reply with quote

Hi Frank,

I finally got around testing this, sorry for the delay... I ran it this morning and I got the following error (RC 16)

Code:
ICE630I 0 MODE IN EFFECT:  STOP                                               
                                                                               
          COPY FROM(IN) USING(CTL1)                                           
ICE606I 0 DFSORT CALL 0001 FOR COPY FROM IN       TO OUTFIL   USING CTL1CNTL TERMINATED
ICE602I 0 OPERATION RETURN CODE:  16                                           
                                                                               
ICE630I 2 MODE IN EFFECT:  SCAN                                               
                                                                               
          COUNT FROM(T1) NOTEMPTY RC4                                         
ICE612I 0 NO ERRORS FOUND IN STATEMENT
                                                                           
                                                                           
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  16               
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001                                                                   
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 08:10 ON FRI AUG 25, 2006 -
          * CHANGE SPACES TO '0'S.                                           
            ALTSEQ CODE=(40F0)                                               
            INREC OVERLAY=(24:24,34,TRAN=ALTSEQ)                             
          * INCLUDE ANY RECORD WITH NON-NUMERIC VALUES.                       
            OUTFIL FNAMES=T1,INCLUDE=(24,34,FS,NE,NUM)                       
                                                  $                           
ICE113A E COMPARISON FIELD ERROR                                             
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW 
          DEBUG NOABEND,ESTAE                                                 
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN,DYN*
                         ALLOC                                               
          SORT FIELDS=COPY                                                   
ICE052I 3 END OF DFSORT                                                       


I looked up the error IEC602I & IEC200I, but cannot figure out the problem.
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Aug 25, 2006 5:57 pm
Reply with quote

The above was the TOOLMSG log....

The DFSMSG log is:

Code:
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001                             
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 08:10 ON FRI AUG 25, 2006 -
          * CHANGE SPACES TO '0'S.                                           
            ALTSEQ CODE=(40F0)                                               
            INREC OVERLAY=(24:24,34,TRAN=ALTSEQ)                             
          * INCLUDE ANY RECORD WITH NON-NUMERIC VALUES.                       
            OUTFIL FNAMES=T1,INCLUDE=(24,34,FS,NE,NUM)                       
                                                  $                           
ICE113A E COMPARISON FIELD ERROR                                             
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW 
          DEBUG NOABEND,ESTAE                                                 
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN,DYN*
                         ALLOC                                               
          SORT FIELDS=COPY                                                   
ICE052I 3 END OF DFSORT                                                       
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 25, 2006 7:58 pm
Reply with quote

The error message indicates you don't have DFSORT R14 PTF UK90006 (April, 2006) installed. You need the April, 2006 PTF to use NUM. Ask your System Programmer to install that PTF (it's free).
Back to top
View user's profile Send private message
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Fri Aug 25, 2006 8:18 pm
Reply with quote

Thanks for the info... the problem is, I have no clue who that would be in this place...I will eventually figure out who, but good luck.
Thx!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 25, 2006 8:45 pm
Reply with quote

yianis,

Try this alternative DFSORT/ICETOOL job that doesn't require the April, 2006 PTF:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(4,4)),DISP=(,PASS)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) NOTEMPTY RC4
/*
//CTL1CNTL DD *
  ALTSEQ CODE=(40F0,F1F0,F2F0,F3F0,F4F0,F5F0,F6F0,
    F7F0,F8F0,F9F0)
  INREC OVERLAY=(24:24,34,TRAN=ALTSEQ)
  OUTFIL FNAMES=T1,INCLUDE=(24,34,ZD,NE,+0)
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top