View previous topic :: View next topic
|
Author |
Message |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hi,
I have a variable with declaration S9(5)V99 COMP-3.
Few records in IP file has non-numeric value for this variable. My requirement is to verify the variable & populate zeroes if the variable value is a non-numeric one.
File layout - 400 bytes; Recfm=FB
Occurence of the variable - 376 to 379 column (i.e, 4 bytes)
How to verify the variable value? I know it could be done through INREC IFTHEN option, but dont know how to code WHEN condition.
Note: Nothing should be done if the value is a numeric one. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Since "You can specify all of the logical expressions in the same way that you can specify them for the INCLUDE statement....", look at the "Numeric Tests" under the "INCLUDE Control Statement" section in "Chapter 3. Using DFSORT Program Control Statements" in "DFSORT Application Programming Guide".
fo example: "INCLUDE COND=(1,20,FS,EQ,NUM)" |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
murmohk1,
Here's a DFSORT job that will do what you asked for. I assumed you wanted PD zeros for non-numeric values. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's NUM function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Use [URL] BBCode for External Links
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/400)
//SORTOUT DD DSN=... output file (FB/400)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(376,4,PD,NE,NUM),
OVERLAY=(376:+0,TO=PD,LENGTH=4))
/*
|
|
|
Back to top |
|
|
|