Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us