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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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