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
 
Replacing the junk values in a field with spaces

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

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon Aug 11, 2008 5:32 pm    Post subject: Replacing the junk values in a field with spaces
Reply with quote

Hi,

I have an input vsam file which is of 80 bytes length
with following feilds
KEY - X(07)
Filler- X(01)
QTY - S9(07) COMP-3
Rest all the feilds is spaces.

I need to check weather the qty feilds is not numeric, and replace with spaces.

Ex:
Code:

0001963 ...@
0001963 ...<
0002035     
0002043 ...<



Basically for the third record we have some junk value(non numeric value) which should be replaced with zeroes.
Hope I am clear

Thanks,
Balu
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Aug 11, 2008 5:43 pm    Post subject:
Reply with quote

Replacing a nonnumeric with spaces (nonnumeric) sounds like a bad idea, wouldn't zeros be a better idea!
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon Aug 11, 2008 6:11 pm    Post subject:
Reply with quote

I am sorry
Quote:

I need to check weather the qty feild is not numeric, and replace with spaces

I need to replace with zeroes if any non numeric is there in that comp-3 field.
Code:

OPTION COPY                         
OUTREC OVERLAY=(84,4,TRAN=ALTSEQ)   
ALTSEQ CODE=(40F0)                 

I have tried giving this but not sucessful
One more thing is
I need to change in that VSAM file itself,
can this be done in a single step.

Thanks,
Balu
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 11, 2008 9:03 pm    Post subject:
Reply with quote

Hello,

Please post the sample data in HEX. It appears as though there are valid packed-decimal numbers and the problem may be understanding them.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon Aug 11, 2008 9:17 pm    Post subject:
Reply with quote

Hi,
Please find the sample data with hex values
Code:

0001963 ...@
FFFFFFF 0017
0001963 000C
           
0002035     
FFFFFFF 4444
0002035 0000
           
0002043 ....
FFFFFFF 0000
0002043 000C


for key 0002035
the value is spaces, I want to replace with zero qty

Thanks,
Balu
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 Aug 11, 2008 9:43 pm    Post subject:
Reply with quote

Here's a DFSORT job that will make the change you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  RECORD TYPE=F
  INREC IFTHEN=(WHEN=(9,4,PD,NE,NUM),OVERLAY=(9:X'0000000C'))
/*


Quote:
One more thing is
I need to change in that VSAM file itself,
can this be done in a single step.


Yes, it can be done in a single step (with ICETOOL) but not in a single pass which is what I think you're really asking.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 11, 2008 9:44 pm    Post subject:
Reply with quote

Hello,

I believe the requirement definition needs a slight modification icon_wink.gif

When the field is spaces, packed decimal zeros should be moved to the field. Might there be any other invalid value(s) or are spaces the only problem value?
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 Aug 11, 2008 9:54 pm    Post subject:
Reply with quote

Quote:
Basically for the third record we have some junk value(non numeric value) which should be replaced with zeroes.


Although the requirement was a bit unclear, I guessed from all that was said that any non-numeric value should be replaced by a PD 0, and that's how I coded my solution. Obviously, blanks is a subset of that and will be taken care of by my solution.

If blanks is the only value that should be replaced by zeros, then this INREC statement could be used:

Code:

  INREC IFTHEN=(WHEN=(9,4,CH,EQ,C' '),OVERLAY=(9:X'0000000C'))
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 Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
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 JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

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