View previous topic :: View next topic
|
Author |
Message |
chockalingam_rsp
New User
Joined: 13 Aug 2009 Posts: 43 Location: chennai
|
|
|
|
Hi ,
I want to pass values from a PS file to the sort card in a DFSORT .
The below is my JCL. Instead of hard-coding in side the jcl . i want to pass the values 1111111, 2222222 from a ps file.
Code: |
//JS010R EXEC PGM=SORT
//SYSOUT DD SYSOUT=X
//SYSPRINT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SORTIN DD DSN=INPUT.PROD.FILE,
// DISP=SHR,DCB=BUFNO=35
//SORTOUT DD DSN=OUTPUT.EXTRACT.FILE,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=((5,9,CH,EQ,C'11111111'),OR,
(5,9,CH,EQ,C'22222222'))
/*
//
|
When i went searched through the other materials ,, they said this can be done via JP function , but i am not sure how reading a file can be done via this function.
Thanks for the help in advance |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You read the file which contains the values, with SORT or something else, and generate either all or the required card only (if doing the required one only, you concatentate to get the rest of the hand-written control cards into the step). |
|
Back to top |
|
|
chockalingam_rsp
New User
Joined: 13 Aug 2009 Posts: 43 Location: chennai
|
|
|
|
Can you give the sample jcl on how to go about this ? |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Use SYMNames
Code: |
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=Your PS file should be FB/80
|
Your PS file should have
Code: |
VALUE1,C'11111111'
VALUE2,C'22222222'
|
Your SYSIN card should be like below
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=((5,9,CH,EQ,C'VALUE1'),OR,
(5,9,CH,EQ,VALUE2))
/*
|
If this is not working for you, then go for a joinkeys. |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
correction in sysin card
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=((5,9,CH,EQ,VALUE1),OR,
(5,9,CH,EQ,VALUE2))
/* |
|
|
Back to top |
|
|
chockalingam_rsp
New User
Joined: 13 Aug 2009 Posts: 43 Location: chennai
|
|
|
|
Thanks a lot magesh ,
Just 1 more question. The syntax you have given is for a definite value. Say the PS file is being FTPed from other application and daily the no of records varies, how do we handle that kind of scenario ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you had a fixed number of values in the file, you could generate the symbols/SYMNAMES.
You don't, so you have to generate the control cards as previously suggested.
JOINKEYS is a possibility, but will use more resources, particularly if your file to run the include on is large and not in 5,9 order. |
|
Back to top |
|
|
|