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

Referback the DCB of SORTIN while using DFSORT in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venksiv

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Tue Mar 15, 2016 5:47 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Tue Mar 15, 2016 7:33 pm
Reply with quote

What do you mean by it not working? How would you like to refer to the DCB, for what reason?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Mar 15, 2016 8:12 pm
Reply with quote

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

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Wed Mar 16, 2016 12:18 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Mar 16, 2016 12:49 pm
Reply with quote

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

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed Mar 16, 2016 2:56 pm
Reply with quote

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

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Mar 16, 2016 4:12 pm
Reply with quote

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

New User


Joined: 20 Jun 2015
Posts: 26
Location: INDIA

PostPosted: Thu Mar 17, 2016 3:24 pm
Reply with quote

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top