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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Sep 26, 2008 5:08 pm
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
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: 2481
Location: @my desk

PostPosted: Fri Sep 26, 2008 5:20 pm
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
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: 2481
Location: @my desk

PostPosted: Fri Sep 26, 2008 6:39 pm
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
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
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: 2481
Location: @my desk

PostPosted: Fri Sep 26, 2008 7:07 pm
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
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
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: 2481
Location: @my desk

PostPosted: Fri Sep 26, 2008 7:32 pm
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: 496
Location: USA

PostPosted: Sat Sep 27, 2008 2:39 am
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
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: 2481
Location: @my desk

PostPosted: Sat Sep 27, 2008 8:11 am
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

Moderator Emeritus


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

PostPosted: Sat Sep 27, 2008 9:16 am
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: 496
Location: USA

PostPosted: Mon Sep 29, 2008 7:31 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top