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
 

 

Popultae zero to pd variable if the value is non-numeric

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

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon May 07, 2007 6:58 pm    Post subject: Popultae zero to pd variable if the value is non-numeric
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon May 07, 2007 7:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon May 07, 2007 8:59 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

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
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 Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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