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

pass values from a PS file to sort card in DFsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Thu Jul 23, 2015 9:01 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 23, 2015 9:09 pm
Reply with quote

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
View user's profile Send private message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Thu Jul 23, 2015 9:17 pm
Reply with quote

Can you give the sample jcl on how to go about this ?
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Fri Jul 24, 2015 12:04 am
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Fri Jul 24, 2015 12:27 am
Reply with quote

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
View user's profile Send private message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Fri Jul 24, 2015 1:09 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 24, 2015 11:19 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top