Page 1 of 1

Help on SORT controlcard

PostPosted: Fri May 23, 2014 3:13 pm
by ravisankarc
Hi All,

I have a dataset with FB 80/800 and it contains list of userid's (in the 1st position and length is 8 characters) as shown below. Actually I have more than 5000 userid's in the dataset.Here, I have just indicated the example but not given the actual userid.

userid1
userid2
userid3
userid4
userid5
userid6
userid7
userid8
userid9
userid10


I want to read each and every userid and put the desired output in the output dataset(indicated in SORTOUT). In order to do this I am using SYMNAMES concept with SORT and below is my JCL. With this JCL I am able to get the desired output for one userid. I want to know on how to refer the SYMNAMES through a dataset. My SORTIN dataset is a VB file contains huge data(more than 6lac records)

//STEP001  EXEC PGM=SORT                                     
//SYMNAMES DD *                                             
  TARG1,'USERID1'                                             
//SORTIN   DD DISP=SHR,DSN=i/p d/s               
//SORTOUT  DD DISP=MOD,DSN=o/p d/s     
//SYSPRINT DD SYSOUT=*                                       
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                             
  OPTION VLSCMP                                             
  INCLUDE COND=((29,05,CH,EQ,TARG1),AND,                     
               (09,2,CH,EQ,C'D '),AND,                       
               (79,2,BI,EQ,B'00000010'))                     
  SORT FIELDS=(29,44,CH,A)                                   
  OUTFIL VTOF,BUILD=(29,05,2X,13,4,2X,29,44,2X,C'PO',       
                     160:X)                                 
/*                                                           


Hope I am clear in explaining my requirement. Please look into it and help me on the same.

Thanks N Regards
Ravi

Re: Help on SORT controlcard

PostPosted: Fri May 23, 2014 3:42 pm
by enrico-sorichetti
while the description might be clear to You
it is really very foggy for somebody willing to help

for example
first You say that the SORTIN is around 5000 records and the format is FB
after that You say that Your SORTIN is around 6lac and the format is VB

just take a decision ...

unless You wanted to say that You have
a LARGE VB file
a SMALL FB file
and You want to extract from the LARGE file some info about the USERIDS contained in the SMALL file

PS
since the official language of the forum is ENGLISH please refrain from using local units of measure ( lac' s)

Re: Help on SORT controlcard

PostPosted: Fri May 23, 2014 4:24 pm
by ravisankarc
Hi Enrico,

Sorry for the ambiguity. I am telling that I have a dataset which has 5000 user id's. My requirement is I want to take each userid and it should be placed in the the below control card dynamically and should fetch the data from my SORTIN dataset and place the output in SORTOUT dataset.

OPTION VLSCMP
INCLUDE COND=((29,05,CH,EQ,USERID),AND,
(09,2,CH,EQ,C'D '),AND,
(79,2,BI,EQ,B'00000010'))
SORT FIELDS=(29,44,CH,A)
OUTFIL VTOF,BUILD=(29,05,2X,13,4,2X,29,44,2X,C'PO',
160:X)

Hope I am clear now.

Sorry to use the local units of measure and will not repeat in future.

Regards
Ravi

Re: Help on SORT controlcard

PostPosted: Fri May 23, 2014 4:30 pm
by enrico-sorichetti
well... the ugly wording and the subsequent MISCOMMUNICATION
depend on the WRONG approach.

search this forum or the sibling one ( http://ibmmainframes.com )
for a JOINKEYS example ( quite a few around )