MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing Parametres to SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kris_madras
Beginner


Joined: 07 Apr 2004
Posts: 41
Topics: 30

PostPosted: Tue Sep 28, 2004 10:03 am    Post subject: Passing Parametres to SORT Reply with quote

Hi,


I am passing YEAR as a parametre to the SYNCSORT as :



// SET YY=04
//S10S EXEC PGM=SORT,PARM=&YY
//SYSIn DD *
// SORT FIELDS=OPY
// OUTREC FIELDS=(1,C.....)

I am trying to use YY value in OUTREC fields..
While sorting the Input file , the requirement is write YY PARA METRE in the output location 1 byte


i.e. instead of OUTREC FIELDS=(1,C'04')

Please let me know How can I change the above declaration to use PARM (YY)...?



Thanks
Kris
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Sep 28, 2004 11:00 am    Post subject: Reply with quote

You may want to review this link:

http://www.mvsforums.com/helpboards/viewtopic.php?t=2940

and pay close attention to using the SYMNAMES DD statement in your SORT job.
Back to top
View user's profile Send private message
kris_madras
Beginner


Joined: 07 Apr 2004
Posts: 41
Topics: 30

PostPosted: Wed Sep 29, 2004 12:25 am    Post subject: Reply with quote

Superk,
Thanks for your reply. But the case is :

// SET YEAR1=04
//SORTTES1 JOB 00000,'RITE AID EXTRACT ',........
//S10S EXEC PGM=SORT
//SORTIN DD DSN=DSNAME,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,YEAR1)
//*

The SYMNAMES DD Statement suggested in the forum :
//SYMNAMES DD *
YEAR1 C'04'

My requirement is without giving a constant value i.e. C'04' , I need to pass from symbolic variable.

like

//SYMNAMES DD *
YEAR1 &YY ----------------> YY is a symbolic parametre(has some value in priror statements)


Thanks
Kris
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Sep 29, 2004 5:30 am    Post subject: Reply with quote

kris,

Please post the requirement , so that we can suggest an alternate solution. Sort products are not capable of receiving parms. However you can create a dynamic control cards.

Thanks,

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Sep 29, 2004 1:36 pm    Post subject: Reply with quote

This is just one possible solution that I came up with:
Code:

//MYJOB JOB (...),CLASS=X,MSGCLASS=X
//*
// SET YY=04
//*
//* USE THE VARIABLE YY WITHIN A DATASET NAME
//*
//STEP0001 EXEC PGM=IEFBR14
//DD1 DD DSN=&SYSUID..ALLOC.YEAR&YY,DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)
//*
//* USE THE 'DELETE' COMMAND TO CREATE A MESSAGE:
//* IDC0550I ENTRY (A) SUPERK.ALLOC.YEAR04 DELETED   
//*
//STEP0002 EXEC PGM=IKJEFT01,
//         PARM='DELETE ''&SYSUID..ALLOC.YEAR&YY''' 
//SYSTSIN DD DUMMY
//SYSTSPRT DD DSN=&&TMP1,DISP=(NEW,PASS),
//  UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),RECFM=FB,LRECL=133
//*
//* RETRIEVE THE VALUE FOR 'YY' FROM THE APPROPRIATE COLUMN
//* OF THE IDC0550I MESSAGE.
//*
//STEP0003 EXEC PGM=SORT                             
//SORTIN   DD   DSN=&&TMP1,DISP=(OLD,DELETE)                   
//SORTOUT  DD   DSN=&&TMP2,                   
// DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                   
//SYSOUT   DD   SYSOUT=*                             
//SYSIN    DD   DATA                                 
   SORT FIELDS=COPY                                   
   OUTFIL ENDREC=1,                                   
   OUTREC=(1:C'YEAR1,',C'C',X'7D',38,2,X'7D',80:X)   
/*                                                   
//*
//* OUTPUT IN &TMP2 IS YEAR1,C'04'
//*
//STEP0004 EXEC PGM=SORT
//SORTIN DD input ....
//SORTOUT DD output ...
//SYMNAMES DD   DSN=&&TMP2,DISP=(OLD,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD DATA
   SORT FIELDS=COPY
   OUTREC FIELDS=(1:YEAR1,......)
/*
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group