View previous topic :: View next topic
|
Author |
Message |
venksiv
New User
Joined: 20 Jun 2015 Posts: 26 Location: INDIA
|
|
|
|
Hi All,
I referred a simple sample REXX showing how to use DFSORT in REXX.
IBMMAINFRAMES.COM/ABOUT51202.HTML#IXZZ42ZNZCPYO
This code works perfectly for files of known LRECL (or DCB in general).
Is it possible to refer back the DCB of the SORTIN file?
Please share your expertise. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What do you mean by it not working? How would you like to refer to the DCB, for what reason? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
There doesn't seem to be something like DCB=*.DD in dynamic allocation or the TSO ALLOCATE command, though I could have missed it in my quick survey.
Just a couple of ideas -
If you are using the ALLOCATE TSO command (as opposed to BPXWDYN) you have the LIKE keyword, though there are enough oddities about it I'd avoid it.
Much harder is to LISTDSI the SORTIN dataset, then use the synbols to construct an ATTRIB command, then specify the attribute list you built in the ALLOCATE command. Or use the symbols to build keywords for the ALLOCATE command. RECFM is sort of hard, though the others are fairly easy. I've done RECFM in CLIST (I don't do Rexx very often), so it can't be all that hard! |
|
Back to top |
|
|
venksiv
New User
Joined: 20 Jun 2015 Posts: 26 Location: INDIA
|
|
|
|
Bill - I didn't know how to code DCB=*.SORTIN while using DFSORT in REXX. All I'm trying to find is the equivalent of the below JCL functionality in REXX:
Code: |
//SORTIN DD DISP=SHR,DSN=inputdsn
//SORTOUT DD DSN=outputdsn,
// DISP=(,CATLG,DELETE),
// LABEL=RETPD=180,
// SPACE=(CYL,(50,50),RLSE),
// DCB=*.SORTIN |
Steve - Thanks for your thoughts. Was wondering if we could LISTCAT the entry and decide on the LCRECL by referring the MAXLRECL and AVGLRECL after verifying for NON-VSAM file. This may be a round-about method. I have used this earlier while analyzing VSAM for REPRO JCL generation.
I've read in some posts in our forum that REXX is not recommended for bulk file/records processing. Needed an alternative for processing few files when I'm not in a position to submit jobs during business hours. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
But you never need that for a SORTOUT dataset. DFSORT provides the exact and optimal DCB information for an output dataset. It is best not to provide the DCB information yourself. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
venksiv wrote: |
... Was wondering if we could LISTCAT the entry and decide on the LCRECL by referring the MAXLRECL and AVGLRECL after verifying for NON-VSAM file. This may be a round-about method. I have used this earlier while analyzing VSAM for REPRO JCL generation. ... |
Non-VSAM data set attributes are not stored in the catalog; LISTCAT will not get them. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
Don't do listcat. Do LISTDSI('SORTIN FILE') as steve-myers suggested. Look in the REXX manual for returned values and their format.
There are some gotchas for 'LISTDSI FILE', but if your SORTIN file is acceptable for LISTDSI, then I think this sequence should work:
cc=Listdsi('sortin file')
cc=Bpxwdyn('alloc dd(sortout) da(..) new catalog like('sysdsname')') |
|
Back to top |
|
|
venksiv
New User
Joined: 20 Jun 2015 Posts: 26 Location: INDIA
|
|
|
|
Bill - Thank you very much.. Good knowledge for today!
My learning from this post:
1. Usage of DFSORT in REXX - I dropped my misconceptions
2. LISTDSI can be used to find RECFM, DSORG, LRECL, BLKSIZE, and others
Thanks, Steve and Willy for your valuable inputs.
I tried LISTDSI to find file attributes. Will be very helpful going forward.. |
|
Back to top |
|
|
|