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
 

 

To create job which puts an 'X' at the 512 position in file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To create job which puts an 'X' at the 512 position in file
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: 1187
Location: Bangalore,India

PostPosted: Wed Feb 14, 2007 4:48 pm    Post subject:
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    Post subject: Re: To create job which puts an 'X' at the 512 position in f
Reply with quote

Thanks Ekta

It's working.


Vikas.
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: Wed Feb 14, 2007 9:51 pm    Post subject:
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    Post subject: To inserts zeros(or char's) at specific position in file
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

Moderator Team Head


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

PostPosted: Thu May 31, 2007 5:53 pm    Post subject: Re: To inserts zeros(or char's) at specific position in file
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu May 31, 2007 6:11 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu May 31, 2007 6:36 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Jun 01, 2007 6:02 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Jun 01, 2007 7:10 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat Jun 02, 2007 4:49 pm    Post subject:
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    Post subject:
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    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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