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

Change a position


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

New User


Joined: 03 Jan 2007
Posts: 14
Location: Sweden

PostPosted: Thu Jan 04, 2007 2:17 pm
Reply with quote

Hi again

This time I have a question about replacing one position. The position can contain hexvalues C0-C9 or D0-D9. If it's C0 or D0 I want it to be F0 and so on C9/D9 to F9

File is VB lrecl 133
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 04, 2007 2:19 pm
Reply with quote

Sort has a translate function, but is sounds like you want to make a zoned decimal number with a sign, unsigned?
Back to top
View user's profile Send private message
Garpen

New User


Joined: 03 Jan 2007
Posts: 14
Location: Sweden

PostPosted: Thu Jan 04, 2007 2:25 pm
Reply with quote

Your assumption is correct. We receive the file from a customer who have a date stored as a signed field, now they want that data loaded into a DATE-column in DB2 icon_confused.gif
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Jan 04, 2007 2:25 pm
Reply with quote

Hi Garpen,

This can be done using change option but you please provide 1 example by giving i/p & op .

Dont forget to tell byte postion of that field
Back to top
View user's profile Send private message
Garpen

New User


Joined: 03 Jan 2007
Posts: 14
Location: Sweden

PostPosted: Thu Jan 04, 2007 2:41 pm
Reply with quote

Here is a record from the file :

0200000000000050201055232006103A000?00ABEH 001

It's the bold A(hex C1) I want to change, in this case to hex F1
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Jan 04, 2007 2:53 pm
Reply with quote

Hi there,


Code:
OPTION COPY                                 
OUTFIL OUTREC=(1:1,35,                       
36:36,1,CHANGE=(1,C'A',C'1'),NOMATCH=(36,1),
37:37,101) 


Here I assumed that Bold A is coming at 36th byte including 4 byte of RDW.
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: Thu Jan 04, 2007 10:28 pm
Reply with quote

Garpen,

Here's a DFSORT job that will do what you asked for for all of the values X'C0'-X'C9' and X'D0'-X'D9'. For negative values (D sign), we multiply the value by -1 to get a positive value and use TO=ZD to get an F sign. For positive values (C sign), we use TO=ZD to get an F sign. I assumed the byte you want to change is at position 36.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/133)
//SORTOUT DD DSN=...  output file (VB/133)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(36,1,ZD,LT,+0),
           OVERLAY=(36:36,1,ZD,MUL,-1,TO=ZD,LENGTH=1)),
        IFTHEN=(WHEN=NONE,OVERLAY=(36:36,1,ZD,TO=ZD,LENGTH=1))
/*
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top