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

Conditions on SORT to avoid extra space


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

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 1:29 pm
Reply with quote

Hi
I have coped data from SORTIN to SORTOUT with some conditions, data is copied as per the my conditions, BUT
I have noticed that in SORTOUT there is extra space/values(I am able to see value 4040404040404040.... if I do HEX ON on output file.) after completion of the record etch record till end of the file,
these values (4040404040404040.... if I do HEX ON) is not there in SORTIN,

what extra condition I have to code (if i don't want 4040404040404040.... if I do HEX ON)

would you help me out please?

Regards,
Srini
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Thu Jan 16, 2014 2:03 pm
Reply with quote

Basically 40 is the hex value for SPACE.
It would be better to help you further if you post your code here.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jan 16, 2014 2:27 pm
Reply with quote

As suresh said , It would be great if you could paste your code here.

Also let us know the LRECL for input & output files
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 4:16 pm
Reply with quote

Hi All,

PFB code which is adding spaces at end of every record.

Code:
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=INIT,
         BUILD=(1:1,303)),
IFTHEN=(WHEN=((10,2,ZD,EQ,71),AND,(85,8,ZD,EQ,20140606)),
  OVERLAY=(236:C'Y'))
OPTION DYNALLOC
END
[/img][/b][/code]
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 4:20 pm
Reply with quote

Input file is ISAM file.

Regards,
Srini
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Thu Jan 16, 2014 4:29 pm
Reply with quote

You haven't given us LRECL for input & output files.
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 4:45 pm
Reply with quote

LRECL of input file is 299, and the same also expected in out put, here I am getting problem with padding of spaces at end of etch record in output file.

May I know how I can add image? unfortunately- I am having sort card, input file, output file is in image format only
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Thu Jan 16, 2014 4:54 pm
Reply with quote

Input file LRECL is 299, but in your sort card

Code:
 BUILD=(1:1,303)),


SO, What happens to the data from 300 to 303 ?

What is the LRECL specified for output file in the JCL ?
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 4:59 pm
Reply with quote

I am treating it as VB(299+4RDW digits), I am able over riding at 234th(with OVERLAY=(236:C'Y'))) position, but I am getting problem with padding of spaces at end of etch record.
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 5:01 pm
Reply with quote

I have used LIKE para meter in output file, so that it will properties of input file
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 16, 2014 5:12 pm
Reply with quote

Remove the IFTHEN=(WHEN=INIT with the BUILD. It is making all your records fixed-length, and will pad with space. Are any of the records you are OVERLAYing shorter than that column value?
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 6:31 pm
Reply with quote

I am trying to replace value in 236, but total length of the IAM file is 303(here I have included RDW values while giving positions)
would you please give sort card for the same
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 6:57 pm
Reply with quote

Quote:
Are any of the records you are OVERLAYing shorter than that column value?
----- YES
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 9:38 pm
Reply with quote

I am OK, If I will get solution in 3 or 4 steps also...


Regards,
Srini.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 16, 2014 9:56 pm
Reply with quote

If you are happy extending any short records which meet your criteria, then this should do:

Code:
 OPTION DYNALLOC,COPY
 INREC IFTHEN=(WHEN=((10,2,ZD,EQ,71),AND,(85,8,ZD,EQ,20140606)),
                 OVERLAY=(236:C'Y'))


If you don't want to have the Y on any short records:

Code:
 OPTION DYNALLOC,COPY
 INREC IFTHEN=(WHEN=((1,2,BI,GE,236),   * Checking the record-length
                   AND,
                     (10,2,ZD,EQ,71),
                   AND,
                     (85,8,ZD,EQ,20140606)),
                 OVERLAY=(236:C'Y'))


Since there is only one thing to do, I can't see how to do it in two or more steps.

If this is not want you want, you need to describe what you do want more clearly.
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Fri Jan 17, 2014 5:38 pm
Reply with quote

Thanks a lot Bill Woodger, it is working fine !!!!!


May I know how I can add/post image, (All my sortcard ,I/P,O/P will be in image format, it will help me for next posts)


Thanks a lot for all, for your kind support.

Regards,
Srini
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 17, 2014 5:52 pm
Reply with quote

If you mean the Code tags, click on the Quote button in the top right of a post which is Coded and you will see how it is done.

Above the Post a reply box you will see a lot of buttons. Highlight some text, click a button, is the easiest way.

Please do not post actual images if that is what you mean. Just copy/paste from your emulator screen, and Code the text pasted into the box.
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: Fri Jan 17, 2014 7:55 pm
Reply with quote

Hello,

Quote:
May I know how I can add/post image, (All my sortcard ,I/P,O/P will be in image format, it will help me for next posts)

To repeat what Bill has said:

Attached images/screen shots waste space and do not work well.

Using copy/paste and the Code tag will give the appearance Very similar to the scree. To see how your post will appear, use the Preview. Make changes as needed and when the post looks as you want it, Submit.
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 7
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts How to load to DB2 with column level ... DB2 6
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top