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
 

 

Conditions on SORT to avoid extra space

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Conditions on SORT to avoid extra space
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    Post subject:
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

Moderator


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

PostPosted: Thu Jan 16, 2014 2:27 pm    Post subject:
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    Post subject: Reply to: Need help on SORT
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Need help on SORT
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jan 16, 2014 5:12 pm    Post subject: Reply to: Need help on SORT
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    Post subject:
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    Post subject: Reply to: Need help on SORT
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    Post subject: Reply to: Need help on SORT
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jan 16, 2014 9:56 pm    Post subject: Reply to: Need help on SORT
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    Post subject: Reply to: Need help on SORT
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Jan 17, 2014 5:52 pm    Post subject: Reply to: Need help on SORT
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

Site Director


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

PostPosted: Fri Jan 17, 2014 7:55 pm    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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 Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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