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

Syncsort - INREC OVERLAY


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

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Sat Jan 08, 2011 9:54 am
Reply with quote

Hi

I have a problem with INREC overlay in Syncsort.

My input fields is 9(17) comp-3.

I/p

X'0000ABC1234567890'
X'0000BCC2345678901'
X'0000AAB3456789012'
X'0000BCC4567890123'

O/p

X'0000AAA2345678901'
X'0000AAA4567890123'
X'0000AAB3456789012'
X'0000ABC1234567890'


I need all the BCC changed to AAA and the file needs to be in sorted order after the changes.

I tried

Code:
INREC IFTHEN=(WHEN=(3,2,CH,EQ,C'BCC' ),OVERLAY=(3:C'AAA'))




My problems is i want to replace 1 and half bytes of hex data with some other. I believe this can be done using considering the data as PD.
I tried a few options, didn't work as expected.

Can anyone help me with this?

Thanks,
A
Known is a drop, Unknown is an ocean
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 Jan 08, 2011 10:54 am
Reply with quote

Hello,

The values shown are not packed-decimal. . .

Syncsort questions are posted in the JCL part of the forum, not the DFSORT part of the forum. Topic is being moved.
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 Jan 08, 2011 10:56 am
Reply with quote

Follow on:

Which release of Syncsort is being used?
Back to top
View user's profile Send private message
AneeshMani

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Sat Jan 08, 2011 3:12 pm
Reply with quote

Hi dick,

Why do u say the data is not packed decimal. This is what i see when i do a HEX ON on the input file.

I am new to the shop ( few days.. ) not sure on the version...
Back to top
View user's profile Send private message
AneeshMani

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Sat Jan 08, 2011 3:35 pm
Reply with quote

Hi dick,

The data is Packed decimal. am sure on that one.

This is wat i have used in my prog for the same file.

Code:
01 FIELD-1 PIC 9(17) COMP-3.
01 FIELD-2 REDEFINES FIELD-1.
     05 FILLER PIC 9(4)
     05 SUB-FIELD-1 PIC 9(3)
     05 SUB-FILED-2 PIC 9(10)



Thanks,

A
Back to top
View user's profile Send private message
AneeshMani

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Sun Jan 09, 2011 12:40 am
Reply with quote

Hi dick,

Ignore my prev posts. sorry for the trouble

Why do u say the input is not packed decimal.

This is my actual data.

I/p

X'00008781234567890'
X'00009992345678901'
X'00005673456789012'
X'00009994567890123'

O/p

X'00001112345678901'
X'00001114567890123'
X'00005673456789012'
X'00008781234567890'


This is the HEX form of the data.

I need the 999 replaced by 111 and sorted.

Can you please suggest a way for doing this?

Thanks,
A
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 11, 2011 11:39 am
Reply with quote

Quote:
Why do u say the input is not packed decimal
Because PD data has sign stored in the last half byte and 0-9 in all other positions and your data still does not seem to be valid PD.
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: Tue Jan 11, 2011 11:51 am
Reply with quote

Thanks Arun,

Somehow this topic "got by me" over the weekend. . . icon_redface.gif

d
Back to top
View user's profile Send private message
AneeshMani

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Tue Jan 11, 2011 7:30 pm
Reply with quote

I am sorry. Did not pay much attention to the signed part of the field.

The data will look like this.

X'00001231234567890C'
X'00004562234567891C'


My SYSIN should look like this i beieve

INREC IFTHEN=(WHEN=INIT,
BUILD=(1,80,1,9,PD,EDIT=(TTTTTTTTTTTTTTTTT))),

IFTHEN=(WHEN=(85,3,CH,EQ,C'BCC'),
OVERLAY=(85:C'AAA'))

SORT FIELDS=(85,3,CH,A)

OUTREC FIELDS=(1,80)

I was told I cannot overlay within a PD field.


My apologies dick .. wont happen again.

Thanks,
A
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: Tue Jan 11, 2011 8:57 pm
Reply with quote

Hello,

Quote:
My apologies dick .. wont happen again.
Not to worry - if this was the worst "thing" to happen this year, it would be a very good year icon_smile.gif

Sometimes it takes a couple of iterations to get on the same page, but this is understandable icon_wink.gif

d
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: Tue Jan 11, 2011 9:00 pm
Reply with quote

Hello,

You might consider using a sort-exit to invoke a bit of cobol code to reformat the value before sorting the data.

I'd move the packed-decimal field to a zoned-decimal field, make the change and move the modified zoned-decimal field back to the packed-decimal field.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 13, 2011 11:53 am
Reply with quote

Hi Dick,

I was away for a while. icon_biggrin.gif

Is he trying to overlay numeric values? I got confused by the 'BCC' 'AAA' part.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 13, 2011 12:14 pm
Reply with quote

Quote:
I was told I cannot overlay within a PD field

AneeshMani,

You can replace your entire PD field like this to achieve what you want.
Code:
//SYSIN    DD *                                             
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,9,PD,M11,LENGTH=17)),
       IFTHEN=(WHEN=(85,3,ZD,EQ,999),                       
              OVERLAY=(85:C'111',1:81,17,ZD,TO=PDC))         
 SORT FIELDS=(85,3,CH,A)                                     
 OUTREC BUILD=(1,80)                                         
/*   
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 Jan 13, 2011 8:36 pm
Reply with quote

Hi Arun,

We miss ya when you're away icon_cool.gif

If i understand correctly, the goal is to replace 3 of the packed digits in the field. . .

I believe this could be done if 2 bytes of binary were compared (i.e. 9990, 9991, 9992 - 9999 and replaced with 1110, 1111, 1112 - 1119) but this seems a bit cluttered (at least to me).

I've not looked for a way to compare 1.5 bytes icon_smile.gif

Using the exit, the zoned-decimal work field could be redefined and the 3 digits compared. I also don't know what esle might be part of this process that has not been posted.

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jan 14, 2011 10:14 pm
Reply with quote

Quote:
We miss ya when you're away
Me too.... icon_smile.gif
Quote:
If i understand correctly, the goal is to replace 3 of the packed digits in the field
I also thought the same and the above sort would do it, just a conversion from PD to display, replace the required numbers, sort and convert back.
Back to top
View user's profile Send private message
AneeshMani

New User


Joined: 25 Jan 2008
Posts: 24
Location: india

PostPosted: Sat Jan 15, 2011 12:06 pm
Reply with quote

Hi Arun/D,

Thanks for your help. Here is the CARD that i used to work things out.

Code:

INREC IFTHEN=(WHEN=INIT,
BUILD=(1,80,1,9,PD,EDIT=(TTTTTTTTTTTTTTTTT))),

IFTHEN=(WHEN=(85,3,CH,EQ,C'999'),
OVERLAY=(85:C'111'))

SORT FIELDS=(85,3,CH,A)

OUTREC FIELDS=(1:85,17,ZD,PD,LENGTH=9,2:10,71)



I am expanding the PD to ZD, change data sort and move back. Exactly as you said Arun.

Thanks for your SORT card as well. I will try that as well.

Thanks & Regards,
A
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 Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
Search our Forums:

Back to Top