MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
kris_madras Beginner Joined: 07 Apr 2004 Posts: 41 Topics: 30
Posted: Tue Sep 28, 2004 10:03 am Post subject: Passing Parametres to SORT
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
superk Advanced Joined: 19 Dec 2002 Posts: 684 Topics: 5
Back to top
kris_madras Beginner Joined: 07 Apr 2004 Posts: 41 Topics: 30
Posted: Wed Sep 29, 2004 12:25 am Post subject:
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Sep 29, 2004 5:30 am Post subject:
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
superk Advanced Joined: 19 Dec 2002 Posts: 684 Topics: 5
Posted: Wed Sep 29, 2004 1:36 pm Post subject:
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
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