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
 

 

Change a position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Change a position
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: 3158
Location: Tucson AZ

PostPosted: Thu Jan 04, 2007 2:19 pm    Post subject:
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    Post subject: Re: Change a position
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: 1187
Location: Bangalore,India

PostPosted: Thu Jan 04, 2007 2:25 pm    Post subject:
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    Post subject: Re: Change a position
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: 1187
Location: Bangalore,India

PostPosted: Thu Jan 04, 2007 2:53 pm    Post subject:
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 Moderator


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

PostPosted: Thu Jan 04, 2007 10:28 pm    Post subject:
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    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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm


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