Re: SORT Help with JFY and SQZ

2023-11-09 Thread Wayne Bickerdike
Agree, however, it took me less than 2 minutes to add the code for FIELD
card.

I was responding to the original, however, here's the extra code,

OUT2.I = 'RPT FIELD,TABLE,'||Dbname|| VERSION
SAY REC.I
SAY OUT.I
SAY OUT2.I
D
"EXECIO * DISKW  OFILE(STEM OUT. FINIS "
"EXECIO * DISKW  OFILE(STEM OUT2. FINIS "

Adding a return code for an empty file is also trivial.





On Fri, Nov 10, 2023 at 2:28 PM Sri h Kolusu  wrote:

> >> I tried this in REXX, more familiar for me than DFSORT.
>
> Wayne,
>
> Thanks for the REXX code, however, please note that there is additional
> processing.  OP wants to generate 2 different command files and make a copy
> of the input along with setting a return code if the input file is empty,
> so that they can skip further processing.
>
> Rexx is good at some tasks, but it is not good at I/O when compared to
> DFSORT.
>
> Thanks,
> Kolusu
> DFSORT Development
> IBM Corporation
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne V. Bickerdike

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Sri h Kolusu
>> I tried this in REXX, more familiar for me than DFSORT.

Wayne,

Thanks for the REXX code, however, please note that there is additional 
processing.  OP wants to generate 2 different command files and make a copy of 
the input along with setting a return code if the input file is empty, so that 
they can skip further processing.

Rexx is good at some tasks, but it is not good at I/O when compared to DFSORT. 

Thanks,
Kolusu
DFSORT Development
IBM Corporation

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Wayne Bickerdike
I would probably use a 26 char ALPHA string and index into that to
avoid the stem variable with the hard coded A to F.

or a Hex to Char based on the suffix value

Been a while since I saw Datacom/DB dictionary output :)

On Fri, Nov 10, 2023 at 1:13 PM Wayne Bickerdike  wrote:

> I tried this in REXX, more familiar for me than DFSORT.
>
> My code:
>
> Stor = ''
> ALPHA.1 = 'A'
> ALPHA.2 = 'B'
> ALPHA.3 = 'C'
> ALPHA.4 = 'D'
> ALPHA.5 = 'E'
> ALPHA.6 = 'F'
> "ALLOC F(IFILE) DA('BDB204.OUTLIST(FROM)') SHR REUSE   "
> "ALLOC F(OFILE) DA('BDB204.OUTLIST(TO)') SHR REUSE   "
>   "EXECIO * DISKR  IFILE(STEM REC. FINIS "
> Suffix = 0
> DO I = 1 TO REC.0
>   Parse Value REC.I ,
>   with DBID . . WORD1 Dbname VERSION .
> If POS(Dbname,Stor) > 0 Then Suffix = Suffix + 1
> Else Suffix = 1
>   Stor = Stor || Dbname
>   OUT.I = 'UTL COPY,TABLE,'||Dbname|| ,
>   VERSION || ','|| WORD1 || RIGHT('000' ||DBID,4) || ALPHA.Suffix
>   SAY REC.I
>   SAY OUT.I
> END
>   "EXECIO * DISKW  OFILE(STEM OUT. FINIS "
>
> 400  B400-DATABASE 1001 BRN   B400-BRANCH-BLDG (1001)
> T
> UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
>
> 400  B400-DATABASE3 HST   B400-TRANHIST  (0003) H
>
> UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
>
> 400  B400-DATABASE4 HST   B400-TRANHIST  (0004) H
>
> UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
>
> 400  B400-DATABASE5 HST   B400-TRANHIST  (0005) H
>
> UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C
>
> ***
>
>
> On Fri, Nov 10, 2023 at 4:56 AM Don Johnson <
> 02ee771a0785-dmarc-requ...@listserv.ua.edu> wrote:
>
>> Kolusu, thanks once again! This is now complete and working as I had
>> hoped!
>>
>> Have a good evening!
>> Don
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>
>
> --
> Wayne V. Bickerdike
>
>

-- 
Wayne V. Bickerdike

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Wayne Bickerdike
I tried this in REXX, more familiar for me than DFSORT.

My code:

Stor = ''
ALPHA.1 = 'A'
ALPHA.2 = 'B'
ALPHA.3 = 'C'
ALPHA.4 = 'D'
ALPHA.5 = 'E'
ALPHA.6 = 'F'
"ALLOC F(IFILE) DA('BDB204.OUTLIST(FROM)') SHR REUSE   "
"ALLOC F(OFILE) DA('BDB204.OUTLIST(TO)') SHR REUSE   "
  "EXECIO * DISKR  IFILE(STEM REC. FINIS "
Suffix = 0
DO I = 1 TO REC.0
  Parse Value REC.I ,
  with DBID . . WORD1 Dbname VERSION .
If POS(Dbname,Stor) > 0 Then Suffix = Suffix + 1
Else Suffix = 1
  Stor = Stor || Dbname
  OUT.I = 'UTL COPY,TABLE,'||Dbname|| ,
  VERSION || ','|| WORD1 || RIGHT('000' ||DBID,4) || ALPHA.Suffix
  SAY REC.I
  SAY OUT.I
END
  "EXECIO * DISKW  OFILE(STEM OUT. FINIS "

400  B400-DATABASE 1001 BRN   B400-BRANCH-BLDG (1001) T
UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
400  B400-DATABASE3 HST   B400-TRANHIST  (0003) H
UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
400  B400-DATABASE4 HST   B400-TRANHIST  (0004) H
UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
400  B400-DATABASE5 HST   B400-TRANHIST  (0005) H
UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C
***

On Fri, Nov 10, 2023 at 4:56 AM Don Johnson <
02ee771a0785-dmarc-requ...@listserv.ua.edu> wrote:

> Kolusu, thanks once again! This is now complete and working as I had hoped!
>
> Have a good evening!
> Don
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Wayne V. Bickerdike

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Don Johnson
Kolusu, thanks once again! This is now complete and working as I had hoped!

Have a good evening!
Don

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Ituriel do Neto
I think there is also another option, like below

 //STEP1  EXEC PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                          
//DFSMSG  DD SYSOUT=*                                          
//IN      DD DISP=SHR,DSN=YOUR.DATASET 
//TOOLIN  DD *                                                 
* SET RC=12 IF THE 'IN' DATA SET IS EMPTY, OR                  
* SET RC=0 IF THE 'IN' DATA SET IS NOT EMPTY                   
 COUNT FROM(IN) EMPTY                                          
/*                                                             


Best Regards

Ituriel do Nascimento Neto
z/OS System Programmer






Em quinta-feira, 9 de novembro de 2023 às 13:18:44 BRT, Sri h Kolusu 
 escreveu: 





>> If the input file has no records to process, I would like to set a return 
>> code so I can bypass further processing. Is there a way that I can tweak 
>> this SORT input that you gave me to know if the SORTCMD1 file is empty, and 
>> set a CC for the step?

Don,

Yes, we can set a return code if the file is empty.  Cameron has the right idea 
of using NULLOUT, however it will NOT work in your case as you are using OUTFIL 
processing.  So, the parm you need to use is NULLOFL.

So, change this statement

OUTFIL BUILD=(1,133)

To

OUTFIL BUILD=(1,133),NULLOFL=RC4

This will set RC=4 when the input file is EMPTY.

Thanks,
Kolusu
DFSORT Development
IBM Corporation




--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Sri h Kolusu
>> If the input file has no records to process, I would like to set a return 
>> code so I can bypass further processing. Is there a way that I can tweak 
>> this SORT input that you gave me to know if the SORTCMD1 file is empty, and 
>> set a CC for the step?

Don,

Yes, we can set a return code if the file is empty.  Cameron has the right idea 
of using NULLOUT, however it will NOT work in your case as you are using OUTFIL 
processing.   So, the parm you need to use is NULLOFL.

So, change this statement

OUTFIL BUILD=(1,133)

To

OUTFIL BUILD=(1,133),NULLOFL=RC4

This will set RC=4 when the input file is EMPTY.

Thanks,
Kolusu
DFSORT Development
IBM Corporation



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Cameron Conacher
I believe that NULLOUT might help you here. (OPTION Statement)

Temporarily overrides the NULLOUT installation option, which specifies the 
action to be taken by DFSORT when there are no records for the SORTOUT data 
set, as indicated by an OUT count of 0 in message ICE054I RC0 specifies that 
DFSORT should issue message ICE173I, set a return code of 0, and continue 
processing when there are no records for the SORTOUT data set. RC4 specifies 
that DFSORT should issue message ICE173I, set a return code of 4, and continue 
processing when there are no records for the SORTOUT data set. RC16 specifies 
that DFSORT should issue message ICE206A, terminate, and give a return code of 
16 when there are no records for the SORTOUT data set.


Thanks

…….Cameron

From: IBM Mainframe Discussion List  On Behalf Of Don 
Johnson
Sent: Thursday, November 9, 2023 10:48 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: SORT Help with JFY and SQZ

Hi Kolusu, I have one question about a situation that just came up. If the 
input file has no records to process, I would like to set a return code so I 
can bypass further processing. Is there a way that I can tweak this SORT input 
that you


Hi Kolusu, I have one question about a situation that just came up.



If the input file has no records to process, I would like to set a return code 
so I can bypass further processing. Is there a way that I can tweak this SORT 
input that you gave me to know if the SORTCMD1 file is empty, and set a CC for 
the step?



Don



--

For IBM-MAIN subscribe / signoff / archive access instructions,

send email to lists...@listserv.ua.edu<mailto:lists...@listserv.ua.edu> with 
the message: INFO IBM-MAIN


American Express made the following annotations

This e-mail was sent to you by a representative of Amex Bank of Canada, P.O. 
Box 3204, Station "F", Toronto, ON, M1W 3W7, www.americanexpress.ca. If you no 
longer wish to receive these e-mails, please notify the sender by reply e-mail.

This e-mail is solely for the intended recipient and may contain confidential 
or privileged information. If you are not the intended recipient, any 
disclosure, copying, use, or distribution of the information included in this 
e-mail is prohibited. If you have received this e-mail in error, please notify 
the sender by reply e-mail and immediately and permanently delete this e-mail 
and any attachments. Thank you.

American Express a fait les remarques suivantes
Ce courriel vous a été envoyé par un représentant de la Banque Amex du Canada, 
C.P. 3204, succursale F, Toronto (Ontario) M1W 3W7, www.americanexpress.ca. Si, 
par la suite, vous ne souhaitez plus recevoir ces courriels, veuillez en aviser 
les expéditeurs par courriel.

Ce courriel est réservé au seul destinataire indiqué et peut renfermer des 
renseignements confidentiels et privilégiés. Si vous n’êtes pas le destinataire 
prévu, toute divulgation, duplication, utilisation ou distribution du courriel 
est interdite. Si vous avez reçu ce courriel par erreur, veuillez en aviser 
l’expéditeur par courriel et détruire immédiatement le courriel et toute pièce 
jointe. Merci.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-09 Thread Don Johnson
Hi Kolusu, I have one question about a situation that just came up.

If the input file has no records to process, I would like to set a return code 
so I can bypass further processing. Is there a way that I can tweak this SORT 
input that you gave me to know if the SORTCMD1 file is empty, and set a CC for 
the step?

Don

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Don Johnson
Kolusu, thanks...this gave me just what I needed in those files!

Have a wonder-filled day!
Don

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Sri h Kolusu
>> In total, I am trying to create three output files:
1. The command file with UTL COPY (which I have) 2. The command file with RPT 
FIELD 3. The original input file.

Don,

It is quite simple.  Here is a sample job that will give you the desired 
results.  I assumed that your input has an LRECL=133 and RECM=FB.

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=Your.Input.LRECL.133.FB.File
//SORTOUT  DD SYSOUT=*
//SORTCMD1 DD SYSOUT=*
//SORTCMD2 DD SYSOUT=*
//SYSINDD *
  OPTION COPY
  INCLUDE COND=(1,1,CH,EQ,C'>')
  INREC OVERLAY=(134:55,32,SQZ=(SHIFT=LEFT),
 88,06,
 C',',
 49,03,
 04,04,UFF,EDIT=(),
 SEQNUM,1,BI,START=193,RESTART=(55,32))

  OUTFIL BUILD=(1,133)

  OUTFIL FNAMES=SORTCMD1,
 BUILD=(134,47,SQZ=(SHIFT=LEFT,
 LEAD=C'-UTL COPY,TABLE,',
   LENGTH=80))

  OUTFIL FNAMES=SORTCMD2,
 BUILD=(134,38,SQZ=(SHIFT=LEFT,
 LEAD=C'RPT FIELD,TABLE,',
   LENGTH=80))

/*

SORTOUT will have a copy of the INPUT file as is.

SORTCMD1 file will have.

-UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
-UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
-UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
-UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C

SORTCMD2 file will have.

RPT FIELD,TABLE,B400-BRANCH-BLDG(1001)
RPT FIELD,TABLE,B400-TRANHIST(0003)
RPT FIELD,TABLE,B400-TRANHIST(0004)
RPT FIELD,TABLE,B400-TRANHIST(0005)

Thanks,
Kolusu
DFSORT Development
IBM Corporation


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Don Johnson
Well, I found that I could not release 2 records into the Copy from INREC. So 
here is what I did to produce all the output. Kolusu, if you have an easier 
way, I would be happy to learn and adapt!

This is what I did to get what I needed:

//SYSINDD  * 
  OPTION COPY
  INREC IFOUTLEN=260,IFTHEN=(WHEN=(1,1,CH,EQ,C'>'),  
BUILD=(01,100,   
   55,32,SQZ=(SHIFT=LEFT),   
   88,06,
   C',', 
   49,03,
   04,04,UFF,EDIT=(),
   SEQNUM,1,BI,START=193,RESTART=(55,32),
   180:X,
   C'>', 
   55,32,SQZ=(SHIFT=LEFT),   
   88,06,
   260:X))   
 
  OUTFIL FNAMES=SORTOUT,BUILD=(01,100)   
 
  OUTFIL FNAMES=SORTCMD1,INCLUDE=(1,1,CH,EQ,C'>'),   
 BUILD=(101,79,SQZ=(SHIFT=LEFT,  
   LEAD=C'-UTL COPY,TABLE,'))
 
  OUTFIL FNAMES=SORTCMD2,INCLUDE=(1,1,CH,EQ,C'>'),   
 BUILD=(181,79,SQZ=(SHIFT=LEFT,  
   LEAD=C'-RPT FIELD,TABLE,'))   


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Don Johnson
Thanks for the tip, Kolusu; it worked great!

Now, I was trying to create a second command file, without that last comma and 
field. For example, the statements you gave me created
-UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A

and for the second file, I need
-RPT FIELD,TABLE,B400-TRANHIST(0003)

How easy is it to omit the last 9 chars (the comma plus the HST0400A)? I was 
thinking that I could use a "1" and "2" indicator to create the Build I need, 
and then only select the OUTFIL/OUTREC for the command file I am building - is 
that the best approach (every selected record will create both command files)?

And finally, I had wanted to print out the report in its entirety that I use 
for SORTIN. I tried to add a simple OUTFILE for SORTOUT, but it only had the 
reformatted input. Is there a way to do that here, or will I need a separate 
Gener step?

In total, I am trying to create three output files:
1. The command file with UTL COPY (which I have)
2. The command file with RPT FIELD 
3. The original input file.

Don

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Jay Maynard
I'm getting the distinct impression that DFSORT is becoming a Swiss Army
knife for the systems programmer, much like a SAS DATA step is.

On Wed, Nov 8, 2023 at 9:04 AM Sri h Kolusu  wrote:

> >> Here is my code...can someone help me to get rid of the spaces in the
> name, before the ( value?
>
>
> Don,
>
> You are complicating a simple request.  First build Only the fields you
> need, and you can add the static characters using LEAD on the SQZ operator.
>
> Also, you don't have to get a seqnum in zd format and then convert that
> into a Alphabet, you can directly use a BINARY format with sequence
> starting at 193 and it would be the EBCDIC characters.
>
> //STEP0100 EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SORTIN   DD DISP=SHR,DSN=Your.Input.FB.file
> //SORTOUT  DD SYSOUT=*
> //SYSINDD *
>   OPTION COPY
>   INCLUDE COND=(1,1,CH,EQ,C'>')
>
>   INREC BUILD=(55,32,SQZ=(SHIFT=LEFT),
>88,06,
>C',',
>49,03,
>04,04,UFF,EDIT=(),
>SEQNUM,1,BI,START=193,RESTART=(55,32),
>80:X)
>
>   OUTREC BUILD=(01,80,SQZ=(SHIFT=LEFT,
>LEAD=C'-UTL COPY,TABLE,'))
> /*
>
> The output from this is
>
> -UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
> -UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
> -UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
> -UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C
>
>
> Thanks,
> Kolusu
> DFSORT Development
> IBM Corporation
>
>
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
Jay Maynard

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Sri h Kolusu
>> Here is my code...can someone help me to get rid of the spaces in the name, 
>> before the ( value?


Don,

You are complicating a simple request.  First build Only the fields you need, 
and you can add the static characters using LEAD on the SQZ operator.

Also, you don't have to get a seqnum in zd format and then convert that into a 
Alphabet, you can directly use a BINARY format with sequence starting at 193 
and it would be the EBCDIC characters.

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=Your.Input.FB.file
//SORTOUT  DD SYSOUT=*
//SYSINDD *
  OPTION COPY
  INCLUDE COND=(1,1,CH,EQ,C'>')

  INREC BUILD=(55,32,SQZ=(SHIFT=LEFT),
   88,06,
   C',',
   49,03,
   04,04,UFF,EDIT=(),
   SEQNUM,1,BI,START=193,RESTART=(55,32),
   80:X)

  OUTREC BUILD=(01,80,SQZ=(SHIFT=LEFT,
   LEAD=C'-UTL COPY,TABLE,'))
/*

The output from this is

-UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
-UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
-UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
-UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C


Thanks,
Kolusu
DFSORT Development
IBM Corporation



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: SORT Help with JFY and SQZ

2023-11-08 Thread Bob Bridges
Since listserv emails are always plain-text (well, at least in my experience), 
there's no way for you to control the font used at the other end.  All you can 
send are the text characters; the recipient controls what font is used for 
plain-text emails.

For just the reasons you're thinking of I tell my client to display plain-text 
emails in a fixed-spacing font*, so I looked at the below and thought "what 
formatting issues?  Looks fine to me".  I don't understand why everyone doesn't 
do that.

* It's Consolas, because it's the only one I see that slashes zeroes.

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* Science is a way of trying not to fool yourself.  -Richard Feynman */

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of Don 
Johnson
Sent: Wednesday, November 8, 2023 09:04

Good morning! I am trying to do what I thought was a simple SORT Copy function 
to create some commands from an input file, but I am being thwarted by embedded 
blanks in my line. Here is the input (Sorry for the formatting issues, I am not 
sure how to post fixed-space text): 

+1+2+3+4+5+6+7+8+9+-
>   400  B400-DATABASE 1001 BRN   B400-BRANCH-BLDG  
>(1001) T
>   400  B400-DATABASE3 HST   B400-TRANHIST 
>(0003) H 
>   400  B400-DATABASE4 HST   B400-TRANHIST 
>(0004) H 
>   400  B400-DATABASE5 HST   B400-TRANHIST 
>(0005) H 

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


SORT Help with JFY and SQZ

2023-11-08 Thread Don Johnson
Good morning! I am trying to do what I thought was a simple SORT Copy function 
to create some commands from an input file, but I am being thwarted by embedded 
blanks in my line. Here is the input (Sorry for the formatting issues, I am not 
sure how to post fixed-space text): 

+1+2+3+4+5+6+7+8+9+-
>   400  B400-DATABASE 1001 BRN   B400-BRANCH-BLDG  
>(1001) T
>   400  B400-DATABASE3 HST   B400-TRANHIST 
>(0003) H 
>   400  B400-DATABASE4 HST   B400-TRANHIST 
>(0004) H 
>   400  B400-DATABASE5 HST   B400-TRANHIST 
>(0005) H 

I want to add to this an Alphabetic sequence for duplicate names (the number of 
duplicates cannot be more than 10), but the only way I know to do this is to 
create a 2-digit numeric sequence, and then convert that to a single letter.

Here is the output I get currently:

+10...+20...+30...+40...+50...+60..
-UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
-UTL COPY,TABLE,B400-TRANHIST   (0003),HST0400A
-UTL COPY,TABLE,B400-TRANHIST   (0004),HST0400B
-UTL COPY,TABLE,B400-TRANHIST   (0005),HST0400C

But this is what I want

+10...+20...+30...+40...+50...+60..
-UTL COPY,TABLE,B400-BRANCH-BLDG(1001),BRN0400A
-UTL COPY,TABLE,B400-TRANHIST(0003),HST0400A
-UTL COPY,TABLE,B400-TRANHIST(0004),HST0400B
-UTL COPY,TABLE,B400-TRANHIST(0005),HST0400C

Here is my code...can someone help me to get rid of the spaces in the name, 
before the ( value?

//SYSINDD  *
  OPTION COPY   
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'>'),  
BUILD=(01:01,01,
   02:49,03,
   05:55,32,
   40:88,06,
   50:04,04,UFF,M11,LENGTH=04,  
   60:SEQNUM,2,ZD,START=1,INCR=1,RESTART=(55,32)))  

  OUTFIL FNAMES=SORTCMD2,INCLUDE=(1,1,CH,EQ,C'>'),  
BUILD=(C'-UTL COPY,TABLE,', 
   05,32,   
   40,06,   
   C',',
   02,03,   
   50,04,   
   60,02,CHANGE=(1, 
   C'01',C'A',C'02',C'B',C'03',C'C',C'04',C'D', 
   C'05',C'E',C'06',C'F',C'07',C'G',C'08',C'H', 
   C'09',C'I',C'10',C'J'),NOMATCH=(C'$'),80:X)  

I tried to use 05,32,SQZ=(SHIFT=LEFT), and that may have worked, but then it 
just padded the rest of the 32 bytes with spaces, so it did nothing.

Thanks in advance!

Don Johnson

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN