View previous topic :: View next topic
|
Author |
Message |
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi,
I am taking unload of IMS database in JCL. Some of the fields are packed fields (Comp-3) and I wanted to unpack those fields. I did this through JCL step.
The problem is that some of the packed fields are having spaces in database ( I don't know how, but there are spaces in IMS packed fields). So when I tried to unpack those fields, the o/p file fields are getting populated with 4040 (i.e. Hex values of Space).
So to overcome this, I wanted to check the input file for spaces in packed fields and overlay the spaces with zeros.
I tried below code but it is giving Syntax error
Code: |
//SYSIN DD *
INREC IFTHEN=(WHEN=(17,6,PD,EQ,C' '),
OVERLAY=(C'000000')) |
Quote: |
ERROR: WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE |
I guess, the error is coming because I am checking the packed field as character.
Can anybody tell me how to check the input packed field for Spaces values? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
//SYSIN DD *
INREC IFTHEN=(WHEN=(17,6,CH,EQ,C' '),
OVERLAY=(C'000000'))
|
Try that. But don't. First note the Power of the Code button. Don't let its Power mesmerise you, but use it next time.
The above will get rid of your error message. Your next problem is you are putting character zeros into your packed field. That's not going to work well either.
I also suggest you find out why the fields have space in them, rather than spending all this time worrying about them... you are worried, just because you don't know, aren't you? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if the data is a packed thing it would be batter to overlay it with the the representation of a packed 0
Code: |
000001 //ENRICO1 JOB NOTIFY=&SYSUID,
000002 // MSGLEVEL=(1,1),CLASS=A,MSGCLASS=H
000003 //*
000004 //ICE EXEC PGM=SORT
000005 //SYSOUT DD SYSOUT=*
000006 //SYSPRINT DD SYSOUT=*
000007 //SORTIN DD *
000008
000009
000010 //SORTOUT DD SYSOUT=*
000011 //SYSIN DD *
000012 OPTION COPY
000013 INREC IFTHEN=(WHEN=(1,4,CH,EQ,C' '),
OVERLAY=(1:X'0000000C'))
000014 //
|
result
Code: |
------------------------------------
000044444444444
444444444444444
444444444444444
444444444444444
44444444444444444444
000C0000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
----------------------------------
00004444444444444444
44444444444444444444
44444444444444444444
44444444444444444444
000C0000000000000000
000000000000000000000
000000000000000000000
000000000000000000
-------------------------------------
|
|
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
The problem is that, the database is production database and is managed by some other team.
We are thinkg to check each packed field in program for spaces and move zeros accordingly. But I was checking if we can do that through sort.
Can we somehow over write these input spaces with packed zeros in o/p file? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
We are thinkg to check each packed field in program for spaces and move zeros accordingly. But I was checking if we can do that through sort.
Can we somehow over write these input spaces with packed zeros in o/p file? |
did You care to read and understand the sample I posted ...
looks like not
it does exactly that... if positions 1 to 4 of the input are spaces it overlays them with the hex representation of a packed 0
no reason for anybody to waste time if You are uncapable of such simple understanding |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Thanks Enrico.
Now the problem is that when I tried to unpack this field with the below code, the o/p is coming as '000000-404 '. It should come as '+00000000000'
Code: |
INREC IFTHEN=(WHEN=(17,6,CH,EQ,C' '),
OVERLAY=(17:X'0000000C'))
SORT FIELDS=COPY
OUTREC FIELDS=(1,16,
17,6,PD,EDIT=(STTTTTTTTTTT),SIGNS=(+,-))
|
Can you let me know what I need to change? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Shriram Jogdand wrote: |
[...]
We are thinkg to check each packed field in program for spaces and move zeros accordingly. But I was checking if we can do that through sort.
Can we somehow over write these input spaces with packed zeros in o/p file? |
See enrico's code above. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the only thing to change would Your counting skills
.... You check 6 and overlay 4
Code: |
1 2 3 4 5 6
x'00000000000c' |
and use the code tags, it makes thins more readable for people willing to help |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Thanks ENRICO. |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi Enrico,
I am facing some problem here. The thing is that one record can have spaces at many locations in Comp-3 field. So when I am using the below code, it is not checking for the second field if it satisfies the first condition.
Code: |
INREC IFTHEN=(WHEN=(61,6,CH,EQ,C' '),
OVERLAY=(61:X'00000000000C')),
IFTHEN=(WHEN=(67,6,CH,EQ,C' '),
OVERLAY=(67:X'00000000000C')),
IFTHEN=(WHEN=(80,6,CH,EQ,C' '),
OVERLAY=(80:X'00000000000C')),
IFTHEN=(WHEN=(131,4,CH,EQ,C' '),
OVERLAY=(131:X'0000000C')) |
Now, when the record is satisfying the first condition, then it is converting the field at 61 position correctly but it is not checking the second IFTHEN condition which is for 67 position field.
Can you tell how to resolve this issue and convert all the field? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I don't have SyncSort documentation, but I suspect that including HIT=NEXT in all but the final IFTHEN will get you there. Having satisfied one condition, the default is probably to go on to the next bit of processing, ignoring the other IFTHENs of particular types. Your documentation for SyncSort will make this entirely clear for you. |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Thanks Bill. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Forgetting the technical issues - I question your changing blanks (presumably missing data) to zeros (usually a valid value).
Do your specs or other analyses allow that? |
|
Back to top |
|
|
|