Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

pass values from a PS file to sort card in DFsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: pass values from a PS file to sort card in DFsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Jul 23, 2015 9:09 pm    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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: 159
Location: Chennai

PostPosted: Fri Jul 24, 2015 12:04 am    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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: 159
Location: Chennai

PostPosted: Fri Jul 24, 2015 12:27 am    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Jul 24, 2015 11:19 am    Post subject: Reply to: pass values from a PS file to sort card in DFsort
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us