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
 

 

[Solved]Change the first three position using SYNCSORT

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

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Thu Nov 09, 2006 10:20 am    Post subject: Change the first three position using SYNCSORT
Reply with quote

I have a file with header,trailer and detial record.
I need to change the first three position of these records with different values.
and the syntax am using for this in syncsort is
SORT FIELDS=COPY
OUTREC FIELDS=(1,3,CHANGE=(3,C'xxx',C'yyy',
C'aaa',C'bbb',
C'ccc',C'ddd'),4,157)
Here in header I have XXX which I'm changinf to YYY
and in detail i have AAA which I'm changing to BBB
and in trailer i have ccc and i'm changing that to ddd

I need to add one more condition
where i need to change the 7th position(that field is of length 13)
in my header and trailer to some other value of same length.
I need to include this condition in the same sort card.
Could someone tell me the syntax for that in syncsort.

The file length is 160.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Nov 09, 2006 10:32 am    Post subject: Re: SYNCSORT
Reply with quote

Use syntax like below for all your conditions to replace first 3 chars...
Code:
SORT FIELDS = COPY
OUTREC = (1:1,3,
CHANGE=(3,C'TTT',C'YYY',C'AAA',C'BBB',C'CCC',C'DDD'),NOMATCH=(1,3),
4:4,157)


To replace 13 chars starting at 7th position in Header & Trailer, do you have any specific values coming into that field.?
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Thu Nov 09, 2006 11:03 am    Post subject: Re: SYNCSORT
Reply with quote

Yes I have a value for that 13 length field which is
POST POSITION
and i need to change it to
POST ACTIVITY
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Nov 09, 2006 11:09 am    Post subject: Re: SYNCSORT
Reply with quote

okay... then use the below mentioned SORT CARD...
Code:
SORT FIELDS = COPY
OUTREC = (1:1,3,
CHANGE=(3,C'TTT',C'YYY',C'AAA',C'BBB',C'CCC',C'DDD'),NOMATCH=(1,3),
4:4,3,
7:7,13,
CHANGE=(13,C'POST POSITION',C'POST ACTIVITY',NOMATCH=(7,13),
20:20,141)


Note: Any of your DETAIL records containing "POST POSITION" at 7-13 positions would also be converted to "POST ACTIVITY". So make sure you dont have any such record in DETAIL Records before running the query.

To resolve this; what else is there in positions 4-6 in your HEADER & TRAILER records.
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Thu Nov 09, 2006 11:18 am    Post subject: Re: SYNCSORT
Reply with quote

I may get a value of 001 or 002 or 003 or 004 in the position 4-6
but i don't want to change that position... would that create any problem...
The condition u gave worked fine...
Thanks a lot....
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Nov 09, 2006 11:25 am    Post subject: Re: SYNCSORT
Reply with quote

Quote:
I may get a value of 001 or 002 or 003 or 004 in the position 4-6
but i don't want to change that position... would that create any problem...

No that would not create a problem... I asked to make conditions more specific.
Quote:
The condition u gave worked fine...
Thanks a lot....

Thats fine... but did you notice the note made in my earlier reply. If that is not the case, this SORT is perfact, otherwise we may need to update the SORT CARD.
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Thu Nov 09, 2006 11:28 am    Post subject:
Reply with quote

nope I'll not get that value in the position 7 in my detail records.
but if am going to get it how can we handle that condition?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Nov 09, 2006 11:36 am    Post subject: Re: SYNCSORT
Reply with quote

Quote:
nope I'll not get that value in the position 7 in my detail records.

Then we are fine with the code given above.
Quote:
but if am going to get it how can we handle that condition?

I would put two different SORT CARDS for DETAIL and HEADER/TRAILER.
Code:
SORT FIELDS = COPY
OUTREC = (1:3,
CHANGE=(3,C'AAA',C'BBB',NOMATCH=(1,3),
4:4,157)

Code:
SORT FIELDS = COPY
OUTREC = (1:19,
CHANGE=(19,C'TTT001POST POSITION',C'YYY001POST ACTIVITY',
C'TTT002POST POSITION',C'YYY002POST ACTIVITY',
C'TTT003POST POSITION',C'YYY003POST ACTIVITY',
C'TTT004POST POSITION',C'YYY004POST ACTIVITY',
C'CCC001POST POSITION',C'DDD001POST ACTIVITY',
C'CCC002POST POSITION',C'DDD002POST ACTIVITY',
C'CCC003POST POSITION',C'DDD003POST ACTIVITY',
C'CCC004POST POSITION',C'DDD004POST ACTIVITY',
NOMATCH=(1,19),
20:20,141)
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Thu Nov 09, 2006 11:42 am    Post subject:
Reply with quote

Oh thats really useful... Thanks...
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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