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

To create job which puts an 'X' at the 512 position in file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Wed Feb 14, 2007 4:34 pm
Reply with quote

Hi,


I have to create job which puts an 'X' at the 512 position in file.

Without changing file length, or without changing any other positions.

If on 512th position any other character than 'X' present then replace it by 'X'


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

Moderator


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

PostPosted: Wed Feb 14, 2007 4:48 pm
Reply with quote

Hi Vikas,

I am assuming that file length is 512 bytes. Please find below sort card to change 512 position with X

OPTION COPY
INREC FIELDS=(1,511,C'X')
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Wed Feb 14, 2007 8:28 pm
Reply with quote

Thanks Ekta

It's working.


Vikas.
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: Wed Feb 14, 2007 9:51 pm
Reply with quote

Even simpler with DFSORT would be to use OVERLAY (and it doesn't matter what the record length is):

Code:

   OPTION COPY
   INREC OVERLAY=(512:C'X')
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Thu May 31, 2007 5:48 pm
Reply with quote

Hi all,

I want to inserts zeros(or char's) at specific position in file.

Suppose input file length is 200 & i want to replace 100 to 105 characters by Zero's.

Vikas.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 31, 2007 5:53 pm
Reply with quote

The question was already asked by you, and answered, here.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Thu May 31, 2007 6:03 pm
Reply with quote

Hi Superk,

I tried the solution given by you & Ekta it's working fine for inserting single/multiple character at the end of file only.

Now in anywhere in the file i want to replace characters.

Thank you,


Vikas
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 6:11 pm
Reply with quote

Vikas,

Quote:
Now in anywhere in the file i want to replace characters


Its same.

OPTION COPY
INREC OVERLAY=(100:C'00000')
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Thu May 31, 2007 6:31 pm
Reply with quote

Hi murmohk1


I tried the solution given above it gives ABENDED S000 U0016.
Reason code 0000.

I use Syncsort.



Vikas.
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 May 31, 2007 6:36 pm
Reply with quote

Same idea, slightly different syntax, look at your Syncsort manual, the answer (and example) is there.
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Fri Jun 01, 2007 10:16 am
Reply with quote

hey,

I dont think Syncsort will give an abend for the code Murmokh has given above.

Anyway try this code also.

Code:
SORT FIELDS=COPY                   
INREC FIELDS=(1,100,C'00000',105,95)


or

Code:
SORT FIELDS=COPY           
INREC OVERLAY=(100:C'00000')
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Fri Jun 01, 2007 11:27 am
Reply with quote

Hi all,

I used the following,

Code:
SORT FIELDS=COPY                                 
OUTREC FIELDS=(1:1,254,255:C'XXXXX',260:260,253)


It will put xxxxx at 255-259 position.


Thanks to all,

Vikas
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Fri Jun 01, 2007 5:31 pm
Reply with quote

Hi All,

Suppose from input file

1. If some condition matches then I want to replace 200 to 205 chars by xxxx
2. Else I want to replace 200 to 205 chars by yyyy

The condition 1 can become true anywhere in the record. i need to check only 200 to 205th position & to write all records into one output file as it was present (same sequence as in original file) in the input file by using Syncsort.

If anyone knows how to give IF condition in SORT or any other idea then please let me know.

Thanks,

Vikas.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jun 01, 2007 6:02 pm
Reply with quote

Support for IFTHEN, OVERLAY, and BUILD was built into SyncSort for z/OS 1.2.1.0 and later. What release of SyncSort are you currently running?
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Fri Jun 01, 2007 6:26 pm
Reply with quote

Hi i uses Syncsort version 1.2.1.1R.


Thanks,

Vikas
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jun 01, 2007 7:10 pm
Reply with quote

Then you ought to be able to do what you want by using IFTHEN on the INREC and/or OUTREC statements.

There is a nice Addendum about BUILD, IFTHEN, IFOUTLEN, and
OVERLAY Parameters and some additional material titled Exploiting Synsort Join. If you don't already have them, get intouch with SyncSort Mainframe Support at zos_tech@syncsort.com (from your company email) and tell them Alissa Margulies sent you.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Sat Jun 02, 2007 2:12 pm
Reply with quote

Yes William, I tried out IFTHEN & OVERLAY but the job abends.

I tried this

Code:
INREC IFTHEN=(WHEN=(200,204,CH,EQ,C'ABCD'),         
OVERLAY=(200:C'XXXX')),                     
INREC IFTHEN=(WHEN=NONE,                   
OVERLAY=(200:C'YYYY'))                                                         
SORT FIELDS=COPY   


In dump the messages are
'INCLUDE/OMIT INVALID LENGTH'
'NO KEYWORDS FOUND ON CONTROL STATEMENT'

Could you please provide me sample SORT CARD, So that I will get some Idea? The above code I written by referring Syncsort mannual.

Thanks,

Vikas.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Jun 02, 2007 4:49 pm
Reply with quote

Hello,

I'm not positive, but at a quick look, it apperars as though this
Quote:
WHEN=(200,204,CH,EQ,C'ABCD'
specifies a length of 204 - not what you want.

Starting your control statements in other than position 1 will help as well. Most working examples people post here use 2 spaces before the contorl info begins.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Thu Jul 12, 2007 3:51 pm
Reply with quote

Hi,
I used following card in DFSORT enviornment. Now it's working.

Code:
INREC IFTHEN=(WHEN=(200,4,CH,EQ,C'ABCD'),OVERLAY=(200:C'YYYY')) 
OUTREC IFTHEN=(WHEN=(256,4,CH,EQ,C'PQRS'),OVERLAY=(200:C'XXXX'))
SORT FIELDS=COPY               



Thanks William.

Thanks,
Vikas.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu Jul 12, 2007 4:33 pm
Reply with quote

hi Vikas,

check with the following code,

Code:
SORT FIELDS=COPY
         INREC IFTHEN=(WHEN=(200,6,DT,COND,CRITERIA),OVERLAY=(200:C(XXXXXX)),
                   IFTHEN=(WHEN=(200,6,DT,COND,CRITERIA),OVERLAY=(200:C(YYYYYY))

DT - datatype

Hope this helps you.
Please correct if i am wrong

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

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu Jul 12, 2007 4:37 pm
Reply with quote

hi everyone,

i haven't initially noticed that there is a next page. sorry :-(

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

Moderator Emeritus


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

PostPosted: Thu Jul 12, 2007 7:36 pm
Reply with quote

Not to worry icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top