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
 

 

Fillup default values in Space

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 26, 2011 6:52 pm    Post subject: Fillup default values in Space
Reply with quote

I have a requirement where i have to fill up default values for some columns.

INPUT RECORD
Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6
****** ***************************** Top of Data ******************
000001 12/31/2010 22:00:00             +11111111.11111    ABCDEFGHI
000002 12/31/2010 22:00:00 178036.678  -12345678.12345 10 ABCDEFGHI


OUTPUT RECORD
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6
****** ***************************** Top of Data ******************
000001 12/31/2010 22:00:00          0  +11111111.11111  0 ABCDEFGHI
000002 12/31/2010 22:00:00 178036.678  -12345678.12345 10 ABCDEFGHI


The requirement is to put '0' (Zero) in the places 21-30 and 49-50 if there is a space in the specified positions. I want a generic step instead of coding all the positions and checking.

Is there something grouping we can do instead of coding separate IFTHEN statements as below? As there are many such columns to be checked.

Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(21,10,CH,EQ,C' '),                 
           OVERLAY=(30:C'0')),               
    IFTHEN=(WHEN=(49,2,CH,EQ,C' '),                   
           OVERLAY=(50:C'0'))         



LRECL of the file is 60.

This file will be used to load a DB2 table using load utility and the column is defined as "NOT NULL" so we are supposed to put zeros as the values.

Also can you please let me know if there is any option in the DB2 load utility to achieve the same.

Using DB2 V8 Zos.
Back to top
View user's profile Send private message

gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Jul 26, 2011 6:53 pm    Post subject:
Reply with quote

We have SYncSort in our shop.
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: Tue Jul 26, 2011 9:08 pm    Post subject:
Reply with quote

Hello,

Quote:
Is there something grouping we can do instead of coding separate IFTHEN statements as below?
Huh. . .?

If you want to check 8 separate "things" what good would "grouping" do?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jul 27, 2011 11:11 am    Post subject:
Reply with quote

Ok... Thanks for the reply... Also there is nothing in the Load utility to handle this?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jul 27, 2011 12:03 pm    Post subject:
Reply with quote

Quote:
Code:
Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(21,10,CH,EQ,C' '),                 
           OVERLAY=(30:C'0')),               
    IFTHEN=(WHEN=(49,2,CH,EQ,C' '),                   
           OVERLAY=(50:C'0'))           
 


Doesn't this just put a single '0' in the last byte of each field?

Garry.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 27, 2011 12:10 pm    Post subject:
Reply with quote

Checking the last field position of the fields for a space will do the job too.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Jul 27, 2011 2:19 pm    Post subject:
Reply with quote

Garry Carroll wrote:
Quote:
Code:
Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(21,10,CH,EQ,C' '),                 
           OVERLAY=(30:C'0')),               
    IFTHEN=(WHEN=(49,2,CH,EQ,C' '),                   
           OVERLAY=(50:C'0'))           
 


Doesn't this just put a single '0' in the last byte of each field?

Garry.


Yes, however it then matches TS's example of output. I don't go for holding numerics in effectively "edited" fields, but it is what he says he wants (for now).
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Jul 27, 2011 2:51 pm    Post subject:
Reply with quote

In order to validate more conditions for a single record, try HIT=NEXT parameter. The example which you showed does not bring you the specified output as it stops processing the validation once it encounters a true condition.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Jul 27, 2011 3:29 pm    Post subject:
Reply with quote

PeterHolland wrote:
Checking the last field position of the fields for a space will do the job too.


Works in this sort of example. I always prefer to check the whole field in case it is happens to match on the one byte but the rest is garbled (I believe "junk values" is the contemporary description).

It's not just my day to be picky, I'm always picky :-)
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 27, 2011 4:19 pm    Post subject:
Reply with quote

Bill,

pick someone else please icon_eek.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Jul 27, 2011 4:46 pm    Post subject: Reply to: Fillup default values in Space
Reply with quote

Nobody else is being as useful as you are today, Peter (and I mean that genuinely, except about the "bubbles").
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm


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