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

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


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

Senior Member


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

PostPosted: Mon May 07, 2007 6:58 pm
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: 3156
Location: Tucson AZ

PostPosted: Mon May 07, 2007 7:21 pm
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 Developer


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

PostPosted: Mon May 07, 2007 8:59 pm
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:

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
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top