Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7314

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: 210
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: 210
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: 7314

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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us