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
 

 

copying set of records to o/p file using sort utility.

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

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Fri Sep 26, 2008 5:06 pm    Post subject: copying set of records to o/p file using sort utility.
Reply with quote

Hi everybody. please help me by providing a test JCL solution . my requirement is as follows :
i/p file

113893 aaaba gfgfg89898
114176 fdgdfg dgdfgdfgdfg
122661 dsgfds efdfdfdfdfffr
122662 sdfdffe dfdfdfdfdse
122663 dfgfgfg dgfdfgdfgd
122664 dfdfdff sdfdfdfdfdf
122665 sdfdfdf dfdfdfdfdfd

i want to copy a set of records to an o/p whose first 1-7 ch report values are known. example if report numbers are 113893 , 122662 and 122665 then the o/p file shoud contain the records :

o/p file
113893 aaaba gfgfg89898
122662 sdfdffe dfdfdfdfdse
122665 sdfdfdf dfdfdfdfdfd

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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 26, 2008 5:08 pm    Post subject:
Reply with quote

I assume that by posting in the JCl forum that your product is SYNCSORT rather than DFSORT.

Please use the search button at the top of the page as this topic has been discussed so many times before, with lots of ideas and solutions available in past threads.

As a hint use SORT INCLUDE as your keywords.
Back to top
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Fri Sep 26, 2008 5:18 pm    Post subject:
Reply with quote

can anyone tell me the difference between
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(1,7,CH,EQ,C'113893',OR,
1,7,CH,EQ,C'114176')

-----------------AND-------------------
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'113893')
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'114176')
I am not sure whether this second code is going to run? I am on hold to submit the JCL now.. Plz give suggestions .....


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

Moderator


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

PostPosted: Fri Sep 26, 2008 5:20 pm    Post subject:
Reply with quote

Mukesh,

Submit and see what happens.... icon_lol.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 26, 2008 6:32 pm    Post subject:
Reply with quote

Quote:

//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'113893')
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'114176')


file01 contains records satisfying only first condition even if its disp is mod.

But i dont know why.. Can anybody flash light on reason behind it?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Sep 26, 2008 6:39 pm    Post subject:
Reply with quote

Quote:
Can anybody flash light on reason behind it?

If you give the same file-id more than once in an OUTFIL group, Syncsort will process only the first OUTFIL and simply ignores the rest. Hope this helps
Back to top
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Fri Sep 26, 2008 7:02 pm    Post subject:
Reply with quote

how to avoid giving file id more than once and copy more than one records in the above example ? please suggest.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Fri Sep 26, 2008 7:07 pm    Post subject:
Reply with quote

Mukesh.py wrote:


//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(1,7,CH,EQ,C'113893',OR,
1,7,CH,EQ,C'114176')

-----------------AND-------------------
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'113893')
OUTFIL FILES=01,INCLUDE=(1,7,CH,EQ,C'114176')

Regards,


What is your other JCL doing
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Sep 26, 2008 7:07 pm    Post subject:
Reply with quote

Mukesh.py wrote:
can anyone tell me the difference between
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(1,7,CH,EQ,C'113893',OR,
1,7,CH,EQ,C'114176')
-----------------AND-------------------
Regards,


Did you try the above jcl?
Back to top
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Fri Sep 26, 2008 7:10 pm    Post subject:
Reply with quote

i have not submitted it yet. authorization issue... in both the jcls i am trying to ask whether any one of them meets my requirement. 2nd one is for sure from the above discussions that it wont work.
Back to top
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Fri Sep 26, 2008 7:14 pm    Post subject:
Reply with quote

arcvns, are you trying to say that the below code will work for my requirement?

//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(1,7,CH,EQ,C'113893',OR,
1,7,CH,EQ,C'114176')
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Sep 26, 2008 7:32 pm    Post subject:
Reply with quote

I think it should work for you. Make sure that the control statements dont start at pos-1
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Sep 27, 2008 2:39 am    Post subject: Re: copying set of records to o/p file using sort utility.
Reply with quote

Mukesh.py wrote:
i want to copy a set of records to an o/p whose first 1-7 ch report values are known. example if report numbers are 113893 , 122662 and 122665 then the o/p file shoud contain the records :

o/p file
113893 aaaba gfgfg89898
122662 sdfdffe dfdfdfdfdse
122665 sdfdfdf dfdfdfdfdfd

The following SyncSort for z/OS 1.3 job will produce the requested output:
Code:
//SORT1 EXEC PGM=SORT                   
//SORTIN  DD *                               
113893 AAABA GFGFG89898                     
114176 FDGDFG DGDFGDFGDFG                   
122661 DSGFDS EFDFDFDFDFFFR                 
122662 SDFDFFE DFDFDFDFDSE                 
122663 DFGFGFG DGFDFGDFGD                   
122664 DFDFDFF SDFDFDFDFDF                 
122665 SDFDFDF DFDFDFDFDFD                 
//SORTOUT DD SYSOUT=*
//SYSOUT  DD SYSOUT=*                                           
//SYSIN   DD *                                                   
  SORT FIELDS=COPY                                             
  INCLUDE COND=(1,7,CH,EQ,L(C'113893 ',C'122662 ',C'122665 '))
/*
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Sat Sep 27, 2008 7:52 am    Post subject:
Reply with quote

Hi,Alissa
Quote:

INCLUDE COND=(1,7,CH,EQ,L(C'113893 ',C'122662 ',C'122665 '))


what L in 'L(C'113893 ',C'122662 ',C'122665 ')' means? though when i remove it, I got a abend.. thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Sep 27, 2008 8:11 am    Post subject:
Reply with quote

SyncSort for z/OS Release 1.3 Manual wrote:
INCLUDE/OMIT statements with EQ/OR and NE/AND conditions can now be simplified from having to restate the same field data (p,l,f) when the field is compared with more than one constant.

For example,
INCLUDE COND=1,2,CH,EQ,C'NY',OR,1,2,CH,EQ,C'NJ',OR,1,2,CH,EQ,C'CT',OR,1,2,CH,...) can bewritten more simply as
INCLUDE COND=(1,2,CH,EQ,L(C'NY',C'NJ',C'CT',...)).
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: Sat Sep 27, 2008 9:16 am    Post subject:
Reply with quote

Hello,

Quote:
what L in 'L(C'113893 ',C'122662 ',C'122665 ')' means?
The L tells Syncsort that what comes between () is a list of literals.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon Sep 29, 2008 7:31 pm    Post subject:
Reply with quote

quanzhong wrote:
what L in 'L(C'113893 ',C'122662 ',C'122665 ')' means?

As per the same manual arcvns referred to:
Quote:
The compared constants are grouped together in parenthesis preceded by 'L' for 'list".
...If EQ is specified, the comparison conjunction OR is implied in the statement. If NE is specified, the comparison conjunction AND is implied in the statement...

Hope this helps. Let me know if you have any further questions.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
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 CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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