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: 7241

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 User


Joined: 30 Nov 2013
Posts: 462
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: 7241

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 User


Joined: 30 Nov 2013
Posts: 462
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

New User


Joined: 01 Sep 2015
Posts: 96
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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