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
 

 

Referback the DCB of SORTIN while using DFSORT in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Referback the DCB of SORTIN while using DFSORT in REXX
Reply with quote

Hi All,

I referred a simple sample REXX showing how to use DFSORT in REXX.

HTTP://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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Mar 15, 2016 7:33 pm    Post subject: Reply to: Referback the DCB of SORTIN while using DFSORT in REXX
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: 534
Location: The Universe

PostPosted: Tue Mar 15, 2016 8:12 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Mar 16, 2016 12:49 pm    Post subject: Reply to: Referback the DCB of SORTIN while using DFSORT in REXX
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: 534
Location: The Universe

PostPosted: Wed Mar 16, 2016 2:56 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 141
Location: Switzerland

PostPosted: Wed Mar 16, 2016 4:12 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am


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