Search found 544 matches

by SIMMS7400
14 Mar 2021 03:47
Forum: DOS Batch Forum
Topic: Issue declaring an array and then using it's value
Replies: 8
Views: 5936

Re: Issue declaring an array and then using it's value

Hi Compo - I replaced my section with yours: SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION FOR /F "DELIMS==" %%G IN ('"(SET STR[%COMPUTERNAME%].) 2>NUL"') DO SET "%%G=" SET "_ALL=:5210/Oracle/Drm/ProcessManager|server1.client.com|" FOR %%A IN ( "HYPER-UTIL-PRD|PROD|net.tcp://HYPER-UTIL-aaa%_ALL%...
by SIMMS7400
13 Mar 2021 03:54
Forum: DOS Batch Forum
Topic: Issue declaring an array and then using it's value
Replies: 8
Views: 5936

Re: Issue declaring an array and then using it's value

Hi Compo - Thanks so much, that certainly cuts down on the amount of lines necessary. My only question is how would I set all my variables so I can access them? You have set _ENV here, but how do I set all of them from above? FOR %%G IN ("!STR[%COMPUTERNAME%].ENV!") DO ENDLOCAL & SET "_ENV=%%~G" Or ...
by SIMMS7400
12 Mar 2021 04:43
Forum: DOS Batch Forum
Topic: Issue declaring an array and then using it's value
Replies: 8
Views: 5936

Re: Issue declaring an array and then using it's value

I think I got it. I need to set all of the variables with an array first and then implement and ENDLOCAL: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR %%A IN ( "HYPER-UTIL-PRD|PROD|net.tcp://HYPER-UTIL-aaa:5210/Oracle/Drm/ProcessManager|server1.client.com|server001.onetakeda.com" "HYPER-UTIL-TST|TE...
by SIMMS7400
12 Mar 2021 04:28
Forum: DOS Batch Forum
Topic: Issue declaring an array and then using it's value
Replies: 8
Views: 5936

Issue declaring an array and then using it's value

Hi Folks - I have an automation routine setup that performs a bunch of tasks. In all of my scripts, I first call an "environment" file to set a handful of variables for the given operation. In looking over my "environment" file, there is an opportunity to use an array to populate some variables to e...
by SIMMS7400
10 Feb 2021 15:06
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10503

Re: JREPL Usage - read text file with commas and replace empty value

Hi Dave -

I used the following and it seems to work:

Code: Select all

/exc "1,'USE FOR TERM'
Do you forsee any issues with this update?
by SIMMS7400
10 Feb 2021 13:43
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10503

Re: JREPL Usage - read text file with commas and replace empty value

Hi Dave - I just tried the suggestion but unfortunately doesn't seem to work. Here are the contents of my first column, could the comma be causing an issue? CALL "%UTILPATH%Batch\JREPL" "^((?:[^|]*\|){17})\s*(?=$|\|)" "$1Projected Start Date Missing" /A /exc "1,'(USE FOR TERM)|'b" /f "%FDMEE_BIN%%DA...
by SIMMS7400
10 Feb 2021 11:49
Forum: DOS Batch Forum
Topic: JREPL Usage - read text file with commas and replace empty value
Replies: 12
Views: 10503

Re: JREPL Usage - read text file with commas and replace empty value

HI Dave - I'm hoping this would be an easy tweak but there is a new business need. Per the above JREPL solution you suggested, it's working like a charm!! I do need to add a piece of logic that ignore certain rows that contain a specific string, is that possible? If the first column contains a strin...
by SIMMS7400
02 Feb 2021 03:49
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11435

Re: Best way to setup a "Dictionary" similar to VBA?

Thanks, A. It was a new development or else I would have revealed in the beginning

Thanks for your time, this is fantastic!!

One last question, how do I get this value into a variable?

Code: Select all

call echo Date is : %%DATAFILENAME:~!STR[%DATAFILENAME:~0,2%].DSP!,!STR[%DATAFILENAME:~0,2%].DEP!%%
by SIMMS7400
01 Feb 2021 03:02
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11435

Re: Best way to setup a "Dictionary" similar to VBA?

HI Antonio - Thank you for that suggest. I really do like how you're setting the array definition, nice and clean. One thing I'm running into is that I do have situation where there are multiple Entities which are comma delimited. How would I include them? Do I include them with another delimters an...
by SIMMS7400
30 Jan 2021 03:43
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11435

Re: Best way to setup a "Dictionary" similar to VBA?

Historically, I've done something like @echo off setlocal EnableDelayedExpansion rem Define the set of applications set "app[AA].target_application=Application1" set "app[AA].target_entity=Entity1" set "app[BB].target_application=Application2" set "app[BB].target_entity=Entity2" set /P "dataFile=En...
by SIMMS7400
29 Jan 2021 19:10
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11435

Re: Best way to setup a "Dictionary" similar to VBA?

Simple. Just use an array: @echo off setlocal EnableDelayedExpansion rem Define the set of applications set "app[AA]=Application1" set "app[BB]=Application2" set /P "dataFile=Enter data file: " echo The application is: !app[%dataFile:~0,2%]! Antonio Thank you Antonio! This is great, didn't realize ...
by SIMMS7400
29 Jan 2021 11:36
Forum: DOS Batch Forum
Topic: Best way to setup a "Dictionary" similar to VBA?
Replies: 16
Views: 11435

Best way to setup a "Dictionary" similar to VBA?

Hi Folks - I have a situation where I am loading files to a target Oracle system. The first two letters of the data file dictate the Target application. Rather than extracting the first two letters of the data file then cycling through a bunch of IF ELSE IF logic, is there a way to create a mapping/...
by SIMMS7400
16 Jan 2021 04:58
Forum: DOS Batch Forum
Topic: Issue with executing a command in parallel
Replies: 2
Views: 2816

Issue with executing a command in parallel

Hi Folks - I have the following command that executes an Oracle utility: CALL C:\path\to\util\utility.bat operation Param1 Param2 Param3 Param4 Param5 Param6 && ( ECHO Successful : Execute Data Load Rule ) || ( ECHO Failed : Execute Data Load Rule ) The utility is java based. What it does is while e...
by SIMMS7400
12 Jan 2021 18:03
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4452

Re: Best way to parse out string from output? Is this acceptable?

Compo -

This works like a charm! Will do some more testing but so far so good, Thank you so much!!!
by SIMMS7400
09 Jan 2021 04:06
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 4452

Re: Best way to parse out string from output? Is this acceptable?

HI Antonio - Thank you so much! So for the most part, there should always b e those two conditions (the two slashes for the date at the beginning as well as the two slashes just before the <name_XXXX>.log. However, to ensure it's dynamic, is there a way to extract the string based on the other strin...