Reading VSAM LDS data records

2024-07-24 Thread Don Johnson
Hi all... I have a need to browse a fairly numerous set of VSAM Linear files, 
and to do some reporting on some of the physical records in each file. I 
understand that the physical recordsize on the LDS is the same as the CI Size 
(Blocksize), and that there is no implicit way to separate the logical records 
just by looking at the file. I can't go into much detail about what I am 
seeking, but wanted to ask this great group how to read these LDS files.

Can I read the LDS files like reading an ESDS file using COBOL? Does anyone 
have an example of this, as I have tried a few different programs and could not 
get them to even open the file.

If COBOL won't work, does anyone have something else that will work? I would be 
fine having a subprogram that does this I/O that I could call from Rexx or 
COBOL. Once I get the record (whether 4, 8, 12K or whatever), I can then do 
what I need with it. 

If you have a program that will help me read these LDS files, I would be so 
grateful!

Thanks!
Don Johnson

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


IGGCSI00 Catalog Search interface

2024-03-14 Thread Don Johnson
Good morning!

I am working with the IGGCSI00 module, and have looked at the field 
descriptions and think I am missing something. 

Does anyone know the CSI field name and format where I can discover if a file 
is a BASIC or LARGE DSNtype?

Thanks!
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 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 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 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


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


How to list ciphers used in FTP

2023-08-02 Thread Don Johnson
Hi all!
We are making some changes to one of our internal servers this weekend, and my 
boss would like to confirm the list of ciphers available for FTP clients before 
and after the change.

Is there any subcommand I can issue from my EXEC PGM=FTP client that will list 
the ciphers?

How about from the SSH EXEC PGM=BPXBATCH environment?

Since I need to test both FTP and SFTP access to the servers, I welcome any 
guidance for these that you can give me. The end goal is to produce a 
before/after list showing the differences.

Thanks!
Don Johnson

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


Re: SORTWK space usage

2023-07-05 Thread Don Johnson
Ok, thanks, Kolusu. Unless there would be a compelling reason to redirect the 
SORT a different way, I will let the program determine the best way to go. So 
far, it sounds like each of these memory paths will produce somewhat similar 
stats to other paths, and I would not want to ask my client try to analyze 
everything on a daily basis when they run their job. I will try these so I am 
familiar with them, and will stick these options in my toolbelt in case I see a 
good use.

Thanks again!
Don

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


Re: SORTWK space usage

2023-07-05 Thread Don Johnson
Yes, the records are FB, and I have run several tests today, so I could get a 
"close but not exact" count here to see those results.

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


Re: SORTWK space usage

2023-07-05 Thread Don Johnson
This has been a good thread, even if it is a bit long, and it was quite 
expedient for me, as I had a client just ask me about how to determine sortwork 
sizes needed for a large database file they are processing. The records are 
coming from inside a program via E15/35, so I can't use the standard SORT input.

After reading all these notes and going through the manual, I have built an 
option override, but wanted to get your opinions on it. To all you experts out 
there, are there any potential "gotchas" with using this?

//DFSPARM  DD   * 
  OPTION MSGDDN=SORTMSGS,MSGPRT=ALL,DYNALLOC=(SYSDA,9),DYNSPC=768,
 HIPRMAX=OPTIMAL,MOSIZE=MAX,MOWRK=YES,DSPSIZE=MAX 
/*

Also, I assume there is no way to force a Hipersort or a Dataspace sort? In one 
of my tests this morning, I saw this:
ICE253I 0 RECORDS SORTED - PROCESSED: 456789779, EXPECTED: 456944716  
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 231120 , TRACKS USED: 0   
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES   
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 17474M BYTES   
ICE399I 0 MEMORY OBJECT USED IN ZSORT PATH = 0M BYTES 
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES  
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES  

Should I be concerned about the ICED180 and 188 messages showing they weren't 
used?

Thanks for looking at this!
Don

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


Re: Can I use JOINKEYS?

2023-05-04 Thread Don Johnson
Kolusu, this is great - I did not think this could be done, and it works so 
well. The changed format is fine, as that is easy to understand. Thanks so much 
for teaching me along the way!

Now let me ask, is there a way to incorporate the Sort extract that creates 
either or both of the files into the same step? I have them running as separate 
steps to create the files you used in the Join. For example, here is the 
program that creates the file you called APAR (this is the more dynamic input):

//SYSINDD * 
  SORT FIELDS=(01,10,CH,A)  
  INCLUDE COND=(001,133,SS,EQ,C'DB00248I')  
  INREC IFTHEN=(WHEN=INIT,  
 BUILD=(001,133,SQZ=(SHIFT=LEFT,MID=C' '))),
IFTHEN=(WHEN=(40,40,SS,EQ,C'('),
 PARSE=(%01=(STARTAFT=C', ',ENDBEFR=C'(',FIXLEN=8), 
%02=(ENDBEFR=C')',FIXLEN=8),
%=(STARTAFT=BLANKS,ENDBEFR=BLANKS), 
%03=(ENDBEFR=C'.',FIXLEN=2),
%04=(ENDBEFR=BLANKS,FIXLEN=1),  
%05=(ENDBEFR=BLANKS,FIXLEN=7)), 
 BUILD=(%01,X,   # Module   
%02,X,   # Subprogram   
%03,%04,X,   # Version  
%05, # Last APAR
80:X)),  # Blank fill   
IFTHEN=(WHEN=(40,40,SS,NE,C'('),
 PARSE=(%06=(STARTAFT=C', ',ENDBEFR=BLANKS,FIXLEN=8),   
%=(ENDBEFR=BLANKS), 
%07=(ENDBEFR=C'.',FIXLEN=2),
%08=(ENDBEFR=BLANKS,FIXLEN=1),  
%09=(ENDBEFR=BLANKS,FIXLEN=7)), 
 BUILD=(%06,10X, # Module   
%07,%08,X,   # Version  
%09, # Last APAR
80:X))   # Blank fill   
*   
  OUTREC IFTHEN=(WHEN=(23,1,CH,EQ,C' '),OVERLAY=(40:C'BASE')),  
 IFTHEN=(WHEN=(23,1,CH,NE,C' '),OVERLAY=(40:23,8))  
*   
  OUTFIL IFTHEN=(WHEN=(10,1,CH,NE,C' '),
   BUILD=(01:10,08,X,   
  10:19,03,X,   
  14:40,08,X,   
  23:01,16,SQZ=(SHIFT=LEFT,MID=C'(',TRAIL=C')'),
  133:X)),  
 IFTHEN=(WHEN=(10,1,CH,EQ,C' '),
   BUILD=(01:01,08,X,   
  10:19,03,X,   
  14:40,08,X,   
  23:01,08,X,   
  133:X))   
/*  

If this could be incorporated into the same JOIN step, that would be great, but 
if not, a three-step SORT job is also fine.

Don

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


Can I use JOINKEYS?

2023-05-03 Thread Don Johnson
Hello! I have a question that I hope the DFSORT gurus can answer. I am trying 
to do a 2-file match, but there is a twist here that I am not sure I can reach 
with the Sort JOINKEYS process. From what I have read, I can show matched items 
or unmatched items, but not items greater than a key, while skipping those less 
than or equal. I can do this programmatically, but I am already using SORT to 
create the two files, so if we can stay with the theme here, that would be 
great.

Maybe an example will help. My first file (F1) from a customer contains a list 
of load modules with the latest maintenance APAR applied. it looks something 
like this (sorry, I don't know how to use fixed-width fonts here!):

+10...+20
DBCFMPR  151 LU00071
DBCL1PR  151 LU01081
DBCMPPR  151
DBCNSPR  151 LU01224
DBDMPPR  151
DBDSMPR  151 LU02807

Then, my "Master List" of APARS (F2) looks like this (there are 1 to n entries 
for each module, and a lot more of these than shown)

+1+2+3+---
DBCFMPR  151 RO90903  20160707 2016189
DBCFMPR  151 RO91404  20160808 2016221
DBCFMPR  151 RO94085  20170127 2017027
DBCFMPR  151 RO94783  20170329 2017088
DBCFMPR  151 RO95548  20170414 2017104
DBCFMPR  151 RO95719  20170531 2017151
DBCFMPR  151 RO99532  20171214 2017348
DBCFMPR  151 RO7  20180308 2018067
DBCFMPR  151 SO09143  20190715 2019196
DBCFMPR  151 SO09510  20190809 2019221
DBCFMPR  151 LU00071  20210128 2021028
DBCFMPR  151 LU07865  20221115 2022319
DBCFMPR  151 LU09582  20230412 2023102
DBCGSPR  151 SO12776  20200428 2020119
DBCGSPR  151 LU00053  20210121 2021021
DBCLKPR  151 RO91115  20160726 2016208
DBCL1PR  151 SO15660  20210407 2021097
DBCL1PR  151 LU01081  20210622 2021173
DBCL1PR  151 LU04745  20220415 2022105
DBCL1PR  151 LU05861  20220727 2022208
DBCL1PR  151 LU07115  20221011 2022284
DBCNSPR  151 LU01224  20210518 2021138
DBDMPPR  151 LU07309  20221207 2022341
DBDSMPR  151 LU02338  20210913 2021256
DBDSMPR  151 LU02807  20210921 2021264
DBDSMPR  151 LU09582  20230412 2023102

Now the first list from F1 will be the driver for the process, and there are a 
few scenarios:
1. F1 member/APAR is found as the latest (last, here) entry in F2;
2. F1 member/APAR is found in the list, but there are other entries later 
(lower) in F2;
3. F1 member has no APAR (DBCMPPR and DBDMPPR) and there are no entries for the 
member in F2;
4. F1 member has no APAR (DBCMPPR and DBDMPPR) and there are one or more 
entries for the member in F2;

What I would like to see for output is:

1. Member, Version (151), APAR, "CURRENT"
2. Member, Version, APAR,  "MISSING", 1st newer APAR from F2, then on 
subsequent lines, each newer APAR (Member, Version, and APAR are optional on 
2nd + lines)
3. Member, Version, "BASE", "CURRENT"
4. Member, Version, "BASE" , then as #2 with all missing APARs

Given F1 above, it would look like this:

+1+2+3+4
DBCFMPR  151 LU00071  MISSING LU07865
  MISSING LU09582
DBCL1PR  151 LU01081  MISSING LU04745
  MISSING LU05861
  MISSING LU07115
DBCMPPR  151 BASE CURRENT   
DBCNSPR  151 LU01224  CURRENT
DBDMPPR  151 BASE MISSING LU07309   
DBDSMPR  151 LU02807  MISSING LU09582

I am not married to this output style, so if there is another way to get this 
detail, we can do that. I might want to add the dates of the missing LPARs, 
too, for additional clarity.

As I said, I am not sure that SORT can do this, even though it can do an awful 
lot of cool things. Let me know what you think.

Thanks for your guidance and assistance!

Don Johnson

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


Trying to Parse a LISTCAT with SORT

2022-10-21 Thread Don Johnson
Hello! I just tried to post a question with embedded code and fixed formatting, 
but it was rejected because HTML is not supported.

So I will post it in plain text, and you can cut/paste into notepad or 3270 to 
see how it lines up. If there is a way to use code blocks here, please let me 
know and I won't do this to you again!

Don

Here is the original note...

Hello there. I am trying to use SORT to process a LISTCAT to give me part of 
the DSN and the creation date. I would normally use Rexx for something like 
this, but have over 10 filenames I am working on, and thought this might be 
easier - except I can't get it to work. Part of the problem is that the LISTC 
output is a VBA 137 file, and I have not worked much with VB files. Another 
problem is that the data I want is on two different lines. I can strip the file 
down to these two lines, but can't seem to pull off the individual nodes. Here 
is a sample of how my input file looks for those two lines (without the RDW).

+1+2+3+4+5+6-
NONVSAM --- MYFILE.ABLA.LONGNODE.NODE004.VARNODE1.NOTUSE
   DATASET-OWNER-(NULL) CREATION2018.341
NONVSAM --- MYFILE.ABLA.SHORT.NODE4.RPT2.NOTUSE
   DATASET-OWNER-(NULL) CREATION2015.113
NONVSAM --- MYFILE.ABLA.MIDDLE.N04.REPT3.NOTUSE
   DATASET-OWNER-(NULL) CREATION2022.200
NONVSAM --- MYFILE.ABLA.SHORT.NODE04.RR.NOTUSE
   DATASET-OWNER-(NULL) CREATION2021.026 

The fields in color are the ones I want to have, and as you can see the purple 
(3rd), red (4th), and green (5th) nodes are variable length.

The output should be one line per file, like this:

+1+2+3+4
NODE004  VARNODE1 2018.341 LONGNODE 
NODE4RPT2 2015.113 SHORT
N04  REPT32022.200 MIDDLE   
NODE04   RR   2021.026 SHORT

Here is my mess of code, which gives errors about RDW and just doesn't work.

  OPTION COPY,VLSCMP   
  INCLUDE COND=(001,60,SS,EQ,C'NONVSAM ---',OR,
001,60,SS,EQ,C'CREATION')  
  INREC IFOUTLEN=140,  
 IFTHEN=(WHEN=(06,9,CH,EQ,C'NONVSAM -'),   
  PARSE=(%01=(STARTAFT=C'ABLA.',ENDBEFR=C'.',FIXLEN=8), # NODE3
 %02=(STARTAFT=C'.',ENDBEFR=C'.',FIXLEN=8), # NODE4
 %03=(STARTAFT=C'.',ENDBEFR=C'.',FIXLEN=8))),   # NODE5
 IFTHEN=(WHEN=(42,9,CH,EQ,C'CREATION-'),   
  PARSE=(%04=(STARTAFT=C'',ENDBEFR=BLANKS,FIXLEN=8)), #DATE
  BUILD=(%02,X,
 %03,X,
 %04,X,
 %01,  
 80:X))   # BLANK FILL 
  OUTFIL VTOF,INCLUDE=(35,40,SS,EQ,C'CREATION') 
/* 

Am I reasonably close? (I don't think so...) Bonus points would be given to 
convert the date from .DDD to MMDD!

Thanks for your help!

Don

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


Re: How to update ZSTART variable in ISP Profile

2022-04-26 Thread Don Johnson
Lionel, thank you for this tool. It works perfectly, and saved me a lot of time 
and effort!

Have a great day!
Don

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


How to update ZSTART variable in ISP Profile

2022-04-26 Thread Don Johnson
Hi all, I have a teammate who wants to change his ISPF ZSTART profile variable 
in the ISP profile, and I wanted to see if there is an easy way to do this.

ISPF 7.3 won't work, as that is only showing ISR profile variables.

I can write a quick little utility that will (1) copy ISPPROF to some other 
member, (2) VPUT the ZSTART data into the variable and save it, and (3) submit 
a batch job (using DISP=OLD for ENQ purposes) that will copy the "other" member 
back into ISPPROF after he logs off.

Before I do that, I thought that someone here might have done something like 
this already. It seems like IBM have a utility to do this very thing called 
ISTA in their Data Set Commander product, but we don't have that here.

Thanks!
Don

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


Re: Using SORT to add quotes around CHAR fields? (Listserv)

2022-03-29 Thread Don Johnson
Kolusu, thank you for putting this together. I am hopeful to be able to try it 
out today, but then will be away through next week.

Let me ask one question here. Would it be easier if I changed the separator 
from a comma to a tilde? If so, then the output looks like this
ITM_ID~DESC~SHORT_DESC~U_M~UNIT_PRICE~ON_HAND~COMMIT~INV_HOLD~DISC_QTY~DISC_PCT~B_O_QTY~O
CHAR(10) N.N.~CHAR(30) NOT NULL~CHAR(8) N.N.~CHAR(4) N.N.~DEC(7,2) 
N.N.~DEC(7,0) N.N.~DEC
A1~CARPETED RUBBER 
MATS-FRONT-RED~FLOORMAT~PAIR~22.99~135~205~Y~5000~1.5~0~0~87~02~02
A10001~CARPETED RUBBER 
MATS-REAR(RED)~FLOORMAT~PAIR~12.99~277~14~N~250~1.5~0~0~86~02~20  
A10002~PERSONALIZED VINYL 
MATS(BEIGE)~FLOORMAT~PAIR~19.99~296~7~N~250~1.5~0~0~87~02~03   

That seems to make it easier to get around the comma problem.

What do you think?
Don

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


Re: Using SORT to add quotes around CHAR fields? (Listserv)

2022-03-24 Thread Don Johnson
Wayne, thanks for these great solution ideas - they give me other ideas, too. I 
might try the Datasource for Excel option for another need I have. The IBM DB2 
Rexx is interesting, and I will have to see if I could adapt it to my Datacom 
table (at first blush, it seems too DB2-centric).

Thanks again for these ideas.
Don

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


Re: Using SORT to add quotes around CHAR fields? (Listserv)

2022-03-24 Thread Don Johnson
Kolusu, here are the first 3 column definitions:
CHAR(10) N.N.,
CHAR(30) NOT NULL,
CHAR(8) N.N.,

As you can see, each of the columns is separated by a comma, which is outside 
of the parens. The N.N. is an abbreviation for Not Null, and the abbreviation 
is used when the column width is less than the width of that descriptor. In 
terms of separation of the columns, I believe that all the fields have NN or 
Not Null, so you can only distinguish each column attribute by "NULL," or 
"N.N.," here. Another option is to convert ") N.N." to ") NOT NULL" or 
vice-versa, if that makes parsing easier.

As to the input file, it is VB, and the max data record length is 200 (so, 
VB-204). There are actually several files, but 200 is the longest.

I could write a Rexx program to handle this, but if Sort could do it, it would 
be much simpler.

Thanks again!
Don

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


Using SORT to add quotes around CHAR fields? (Listserv)

2022-03-23 Thread Don Johnson
This is a post now to the listserv, instead of the Google group. Sorry for the 
duplication!

Hi, I have a comma-delimited extract from a file that has numeric and character 
fields, and I would like to turn it into a true CSV file by making the 
character fields quoted.

I have a 2-line header (column names, and column types) which indicates which 
are CHAR fields, but cannot figure out how to capture the information from the 
header to apply to the actual data lines.

For example, I have this in my file:
ITM_ID,DESC,SHORT_DESC,U_M,UNIT_PRICE,ON_HAND,COMMIT,INV_HOLD,DISC_QTY,DISC_PCT,B_O_QTY,ON_ORD,ACT_YR,ACT_MO,ACT_DAY
  
CHAR(10) N.N.,CHAR(30) NOT NULL,CHAR(8) N.N.,CHAR(4) N.N.,DEC(7,2) 
N.N.,DEC(7,0) N.N.,DEC(7,0) N.N.,CHAR(1) N.N.,DEC(7,0) N.N.,DEC(3,1) 
N.N.,DEC(7,0) N.N.,DEC(7,0) N.N.,CHAR(2) N.N.,CHAR(2) N.N.,CHAR(2) N.N.
A1,CARPETED RUBBER 
MATS-FRONT-RED,FLOORMAT,PAIR,22.99,135,205,Y,5000,1.5,0,0,87,02,02
A10001,CARPETED RUBBER 
MATS-REAR(RED),FLOORMAT,PAIR,12.99,277,14,N,250,1.5,0,0,86,02,20  
A10002,PERSONALIZED VINYL 
MATS(BEIGE),FLOORMAT,PAIR,19.99,296,7,N,250,1.5,0,0,87,02,03  
A10003,4-PIECE CARPET MAT SET (BLUE),MAT 
SET,SET,19.99,275,2,N,250,1.5,0,0,87,02,03  
A10004,SPLASH GUARDS-ALUMINUM,SPLSHGRD,PAIR,8.99,523,55,N,500,1.5,0,0,87,02,03  

A10005,SPLASH GUARDS-VINYL,SPLSHGRD,PAIR,8.99,550,25,N,500,1.5,0,0,87,02,03 
 
A10006,MONOGRAMMED SPLASH 
GUARDS,SPLSHGRD,PAIR,11.99,300,0,N,250,1.5,0,0,86,02,20

and want the output to look like this:
"A1","CARPETED RUBBER 
MATS-FRONT-RED","FLOORMAT","PAIR",22.99,135,205,"Y",5000,1.5,0,0,87,02,02
"A10001","CARPETED RUBBER 
MATS-REAR(RED)","FLOORMAT","PAIR",12.99,277,14,"N",250,1.5,0,0,86,02,20  
"A10002","PERSONALIZED VINYL 
MATS(BEIGE)","FLOORMAT","PAIR",19.99,296,7,"N",250,1.5,0,0,87,02,03  
"A10003","4-PIECE CARPET MAT SET (BLUE)","MAT 
SET","SET",19.99,275,2,"N",250,1.5,0,0,87,02,03  
"A10004","SPLASH 
GUARDS-ALUMINUM","SPLSHGRD","PAIR",8.99,523,55,"N",500,1.5,0,0,87,02,03 
 
"A10005","SPLASH 
GUARDS-VINYL","SPLSHGRD","PAIR",8.99,550,25,"N",500,1.5,0,0,87,02,03
  
"A10006","MONOGRAMMED SPLASH 
GUARDS","SPLSHGRD","PAIR",11.99,300,0,"N",250,1.5,0,0,86,02,20

Is there a way to see which column type contains CHAR( -- each of the types is 
column separated -- and then be able to apply quotes to that particular output 
field? I am not sure about this, but hope there is an answer here.

Thank you for your help!
Don Johnson
Sr. Principal Support Engineer  |  MSD - Datacom product family
Broadcom Software

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