Sort PDS files from USS with REXX



IBM's Command List programming language & Restructured Extended Executor

Sort PDS files from USS with REXX

Postby heinvonderwerft » Thu Mar 15, 2012 8:25 pm

Hello,
I try to migrate a simple sort Rexx into USS.

/* SIMPLE REXX CLIST TO CALL DFSORT */
"FREE FI(SYSOUT SORTIN SORTOUT SYSIN)"
"ALLOC FI(SYSOUT) DA(*)"
"ALLOC FI(SORTIN) DA('RVSA.RVSWEB.T52337.S782967') REUSE"
"ALLOC FI(SORTOUT) DA('RVSA.RVSWEB.T52337.S782967') REUSE"
"ALLOC FI(SYSIN) DA('AV01HBE.TRANS.PS') SHR REUSE"
ADDRESS LINKMVS ICEMAN
"FREE FI(SYSOUT SORTIN SORTOUT SYSIN)"

This sort is working fine. When I migrate this to USS I tried this one

/* REXX*/
trace i
KDoutput = 'RVSA.RVSWEB.T52337.S782967'
filename = 'AV01HBE.TRANS.PS'
path = '/tmp/av01hbe'
SORTSTRING.1 = ' SORT FIELDS=(25,44,CH,D)'
/* SORTIEREN AUFRUFEN */
/*call bpxwdyn "ALLOC FI(SYSIN) Lrecl(80) recfm(F) new "*/
call bpxwdyn "alloc fi(SYSIN) da("filename") shr msg(2)"
call bpxwdyn "alloc fi(SYSOUT) path('"path"') Pathmode(SIRWXU) Pathdisp(DELETE,DELETE) Pathopts(OWRONLY,OCREAT,OTRUNC)"
call bpxwdyn "alloc fi(SORTIN) da("kdoutput") shr msg(2)"
call bpxwdyn "alloc fi(SORTOUT) da("kdoutput") shr msg(2)"
address mvs "execio * diskw sysin (FINIS STEM SORTSTRING.) "
address syscall "forkexecm (iceman)"
call bpxwdyn "free fi(sysout)"
call bpxwdyn "free fi(sortin)"
call bpxwdyn "free fi(sortout)"
call bpxwdyn "free fi(sysin)"
return

But no sort was done. What is my problem? I only whant to call the ICEMAN.
how can I call mvs programs from a REXX in Unix System Services?
Has the USS an other sort tool?

Regards Hein
heinvonderwerft
 
Posts: 2
Joined: Thu Mar 15, 2012 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort PDS files from USS with REXX

Postby enrico-sorichetti » Thu Mar 15, 2012 8:31 pm

But no sort was done. What is my problem?

does not tell much. does it?

why not run with a trace and/or display the return code after each command ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Sort PDS files from USS with REXX

Postby NicC » Thu Mar 15, 2012 11:08 pm

No such thing as a 'REXX CLIST' as mentioned in your first snippet. It is either Rexx OR Clist.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Sort PDS files from USS with REXX

Postby heinvonderwerft » Fri Mar 16, 2012 1:05 pm

Oh Sorry I forget my trace :(
Here it is, and I see no errors

3 *-* KDoutput = 'RVSA.RVSWEB.T52337.S782967'
>L> "RVSA.RVSWEB.T52337.S782967"
4 *-* filename = 'AV01HBE.TRANS.PS'
>L> "AV01HBE.TRANS.PS"
5 *-* path = '/tmp/av01hbe'
>L> "/tmp/av01hbe"
6 *-* SORTSTRING.1 = ' SORT FIELDS=(25,44,CH,D)'
>L> " SORT FIELDS=(25,44,CH,D)"
7 *-* /* SORTIEREN AUFRUFEN */
8 *-* /*call bpxwdyn "ALLOC FI(SYSIN) Lrecl(80) recfm(F) new "*/
9 *-* call bpxwdyn "alloc fi(SYSIN) da("filename") shr msg(2)"
>L> "alloc fi(SYSIN) da("
>V> "AV01HBE.TRANS.PS"
>O> "alloc fi(SYSIN) da(AV01HBE.TRANS.PS"
>L> ") shr msg(2)"
>O> "alloc fi(SYSIN) da(AV01HBE.TRANS.PS) shr msg(2)"
>>> "0"
10 *-* call bpxwdyn "alloc fi(SYSOUT) path('"path"') Pathmode(SIRWXU) Pathdisp(DELETE,DELETE) Pathopts(OWRONLY,OCREAT,OTRUNC
>L> "alloc fi(SYSOUT) path('"
>V> "/tmp/av01hbe"
>O> "alloc fi(SYSOUT) path('/tmp/av01hbe"
>L> "') Pathmode(SIRWXU) Pathdisp(DELETE,DELETE) Pathopts(OWRONLY,OCREAT,OTRUNC)"
>O> "alloc fi(SYSOUT) path('/tmp/av01hbe') Pathmode(SIRWXU) Pathdisp(DELETE,DELETE) Pathopts(OWRONLY,OCREAT,OTRUNC)"
>>> "0"
11 *-* call bpxwdyn "alloc fi(SORTIN) da("kdoutput") shr msg(2)"
>L> "alloc fi(SORTIN) da("
>V> "RVSA.RVSWEB.T52337.S782967"
>O> "alloc fi(SORTIN) da(RVSA.RVSWEB.T52337.S782967"
>L> ") shr msg(2)"
>O> "alloc fi(SORTIN) da(RVSA.RVSWEB.T52337.S782967) shr msg(2)"
>>> "0"
12 *-* call bpxwdyn "alloc fi(SORTOUT) da("kdoutput") shr msg(2)"
>L> "alloc fi(SORTOUT) da("
>V> "RVSA.RVSWEB.T52337.S782967"
>O> "alloc fi(SORTOUT) da(RVSA.RVSWEB.T52337.S782967"
>L> ") shr msg(2)"
>O> "alloc fi(SORTOUT) da(RVSA.RVSWEB.T52337.S782967) shr msg(2)"
>>> "0"
13 *-* address mvs "execio * diskw sysin (FINIS STEM SORTSTRING.) "
>L> "execio * diskw sysin (FINIS STEM SORTSTRING.) "
14 *-* address syscall "forkexecm (iceman)"
>L> "forkexecm (iceman)"
15 *-* call bpxwdyn "free fi(sysout)"
>L> "free fi(sysout)"
>>> "0"
16 *-* call bpxwdyn "free fi(sortin)"
>L> "free fi(sortin)"
>>> "0"
17 *-* call bpxwdyn "free fi(sortout)"
>L> "free fi(sortout)"
>>> "0"
18 *-* call bpxwdyn "free fi(sysin)"
>L> "free fi(sysin)"
>>> "0"
19 *-* return
heinvonderwerft
 
Posts: 2
Joined: Thu Mar 15, 2012 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort PDS files from USS with REXX

Postby enrico-sorichetti » Fri Mar 16, 2012 1:24 pm

the blame lies somewhere else :geek:

right from the dfsort manuals
Here is an example of a REXX CLIST to call DFSORT:


but from a strict acronym/abbreviation point of view it is not completely wrong
CLIST ==> Command LIST

even if to be PC I use "CLIST" and "REXX script"
but it is just from a writing/speech style point of view

when saying ".. wrote/used a CLIST"
the sentence looks/sounds complete

but saying "".. wrote/used a REXX"
the sentence looks/sounds somehow suspended
better to put something after REXX "".. wrote/used a REXX script"
but IMNSHO never CLIST, it generates confusion

Here is an example of a REXX script to call DFSORT:

sounds much better, anyway CLIST should not have been capitalized

enough writing style dissertations for today

cheers
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post